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.
29 lines
1.1 KiB
29 lines
1.1 KiB
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using AX.Serialization; |
|
using UnityEngine; |
|
|
|
public class BAG_DATA_SYNC : NetworkMessageBehaviour |
|
{ |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
BagDataSync data = message.Body.Deserialize<BagDataSync>(); |
|
// 根据id找到消防员或者机器人 |
|
GameObject selectobj = EntitiesManager.Instance.GetEntityByID(data.GameObjectID); |
|
// 同步背包数据 不适用添加的方法,因为这样会不停累加数量 |
|
Bags bagData = selectobj.GetComponent<Bags>(); |
|
bagData.EquipData = data.BagData; |
|
// 重新加载背包装备信息,没有穿戴装备的逻辑,在背包就要检测自动穿戴 |
|
bagData.ReloadingSync(); |
|
// 给对应消防员赋值对应水带信息 |
|
if (selectobj.GetComponent<FireManWaterHoseManager>()) |
|
{ |
|
selectobj.GetComponent<FireManWaterHoseManager>().AddEquip(); |
|
} |
|
else if (selectobj.GetComponent<FireRobotWaterHoseManage>()) |
|
{ |
|
selectobj.GetComponent<FireRobotWaterHoseManage>().AddEquip(); |
|
} |
|
} |
|
}
|
|
|