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.
48 lines
1.7 KiB
48 lines
1.7 KiB
5 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using AX.Network.Protocols;
|
||
|
using UnityEngine;
|
||
|
using AX.Serialization;
|
||
|
|
||
|
public class OIL_TANK_INFO_SYNC : NetworkMessageBehaviour {
|
||
|
|
||
|
private Transform OilStandard;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
OilStandard = transform.Find("OilStandard");
|
||
|
}
|
||
|
|
||
|
protected override void Execute(BinaryMessage message)
|
||
|
{
|
||
|
InputHistory.Instance.RegisterInputHistory(message);
|
||
|
|
||
|
var info = message.Body.Deserialize<OilTankInfoSyncData>();
|
||
|
// var sender = info.SendUserID;
|
||
|
if (InputManager.Instance)
|
||
|
{
|
||
|
if (CurrentUserInfo.mySelf.Id != info.SendUserID)
|
||
|
{
|
||
|
if (info.gameObjID == GetComponent<BaseGameObjInfo>().gameObjID)
|
||
|
{
|
||
|
OilTankMessage oilTankMessage =GetComponent<OilTankMessage>();
|
||
|
oilTankMessage.MatterContainer = info.MatterContainer;
|
||
|
oilTankMessage.Reserves = info.Reserves;
|
||
|
oilTankMessage.OutShowHeight =info.OutShowHeight;
|
||
|
//oilTankMessage.SetOilStandard();
|
||
|
OilStandard.transform.localScale =
|
||
|
new Vector3(OilStandard.transform.localScale.x, oilTankMessage.OutShowHeight, OilStandard.transform.localScale.z);
|
||
|
|
||
|
oilTankMessage.TakeTime = info.Taketime;
|
||
|
oilTankMessage.DurationTime = info.DurationTime;
|
||
|
oilTankMessage.FlowRate = info.FlowRate;
|
||
|
oilTankMessage.BoilProb = info.BoilProb;
|
||
|
oilTankMessage.HasLeakeSet = info.HasLeakeSet;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|