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.
34 lines
1.3 KiB
34 lines
1.3 KiB
using AX.InputSystem; |
|
using AX.Network.Protocols; |
|
using AX.Serialization; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.SceneManagement; |
|
|
|
public class CLONE_PERSON_SYNC : NetworkMessageBehaviour |
|
{ |
|
public GameObject ClonePrefab; |
|
public CloneObjType CloneType; |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
//添加回放记录 |
|
InputHistory.Instance.RegisterInputHistory(message); |
|
|
|
var cloneData = message.Body.Deserialize<CloneSyncPersonData>(); |
|
if (cloneData.CloneType == CloneType) |
|
{ |
|
//克隆 |
|
GameObject cloneGO = EntitiesManager.Instance.CreateObj(ClonePrefab, cloneData.ClonePosition, transform, cloneData.CloneID); |
|
//设置克隆数据 |
|
cloneGO.name = cloneData.CloneName; |
|
CloneGameObjInfo info = cloneGO.GetComponent<CloneGameObjInfo>(); |
|
info.gameObjType = cloneData.CloneType; |
|
info.UserID = cloneData.UserID; |
|
info.buildNum = cloneData.BuildNum; |
|
info.floorNum = cloneData.FloorNum; |
|
info.interlayerNum = cloneData.InterLayerNum; |
|
TheHeadName.GetInstance.CreateName(info.gameObjID,cloneGO.name,CloneType.ToString(), 20, Vector3.up * 3f); |
|
} |
|
} |
|
}
|
|
|