You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
4 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using AX.Network;
|
||
|
using AX.Network.Protocols;
|
||
|
using System;
|
||
|
using AX.Serialization;
|
||
|
|
||
|
public class CLONE_SAFEAREA_SYNC : NetworkMessageBehaviour {
|
||
|
protected override void Execute(BinaryMessage message)
|
||
|
{
|
||
|
InputHistory.Instance.RegisterInputHistory(message);
|
||
|
|
||
|
var info = message.Body.Deserialize<SafeAreaSyncData>();
|
||
|
|
||
|
if (InputManager.Instance)
|
||
|
{
|
||
|
if (CurrentUserInfo.mySelf.Id != info.SendUserID)
|
||
|
{
|
||
|
if (info.gameObjType == GetComponent<CloneSafeAreaTool>().cloneObjType)
|
||
|
{
|
||
|
GameObject Prefab = GetComponent<CloneSafeAreaTool>().clonePrefab;
|
||
|
GameObject clone = EntitiesManager.Instance.CreateObj(Prefab, info.ClonePosition, transform, info.gameObjID);
|
||
|
clone.GetComponent<BaseGameObjInfo>().UserID = info.UserID;
|
||
|
clone.GetComponent<BaseGameObjInfo>().gameObjType = info.gameObjType;
|
||
|
clone.GetComponent<CloneGameObjInfo>().floorNum = info.floorNum;
|
||
|
clone.GetComponent<CloneGameObjInfo>().buildNum = info.buildNum;
|
||
|
clone.GetComponent<CloneGameObjInfo>().interlayerNum = info.interlayerNum;
|
||
|
clone.name = info.name;
|
||
|
|
||
|
SelectedObjs.gameObjs.Add(clone);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|