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.
49 lines
1.5 KiB
49 lines
1.5 KiB
4 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using AX.Network.Protocols;
|
||
|
using UnityEngine;
|
||
|
using AX.Serialization;
|
||
|
|
||
|
public class CLONE_WATERCURTAIN_SYNC : NetworkMessageBehaviour
|
||
|
{
|
||
|
private GameObject WaterCurtain = null;//水幕预设
|
||
|
|
||
|
private void Start()
|
||
|
{
|
||
|
if (WaterCurtain == null)
|
||
|
WaterCurtain = Resources.Load("WaterCurtain/WaterCurtain") as GameObject;
|
||
|
}
|
||
|
|
||
|
protected override void Execute(BinaryMessage message)
|
||
|
{
|
||
|
InputHistory.Instance.RegisterInputHistory(message);
|
||
|
|
||
|
var info = message.Body.Deserialize<WaterCurutainSyncData>();
|
||
|
|
||
|
if (InputManager.Instance)
|
||
|
{
|
||
|
if (CurrentUserInfo.mySelf.Id != info.SendUserID)
|
||
|
{
|
||
|
if (info.ParentGameObjId == GetComponent<CloneGameObjInfo>().gameObjID)
|
||
|
{
|
||
|
var WCurtain = EntitiesManager.Instance.CreateObj(
|
||
|
WaterCurtain,
|
||
|
info.ClonePosition,
|
||
|
transform,
|
||
|
info.gameObjID);
|
||
|
|
||
|
WCurtain.name = "WaterCurtain";
|
||
|
|
||
|
CloneGameObjInfo CloneObjInfo = WCurtain.GetComponent<CloneGameObjInfo>();
|
||
|
CloneObjInfo.gameObjType = info.gameObjType;
|
||
|
CloneObjInfo.UserID = info.UserID;
|
||
|
CloneObjInfo.buildNum = info.buildNum;
|
||
|
CloneObjInfo.floorNum = info.floorNum;
|
||
|
CloneObjInfo.interlayerNum = info.interlayerNum;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|