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.
41 lines
1.4 KiB
41 lines
1.4 KiB
5 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using AX.Network.Protocols;
|
||
|
using UnityEngine;
|
||
|
using AX.Serialization;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 水源信息同步
|
||
|
/// </summary>
|
||
|
public class WATER_SOURCE_INFO_SYNC : NetworkMessageBehaviour
|
||
|
{
|
||
|
protected override void Execute(BinaryMessage message)
|
||
|
{
|
||
|
InputHistory.Instance.RegisterInputHistory(message);
|
||
|
|
||
|
var info = message.Body.Deserialize<WaterSourceSyncdata>();
|
||
|
// var sender = info.SendUserID;
|
||
|
if (InputManager.Instance)
|
||
|
{
|
||
|
if (CurrentUserInfo.mySelf.Id != info.SenderId)
|
||
|
{
|
||
|
if (info.GameobjId == GetComponent<BaseGameObjInfo>().gameObjID)
|
||
|
{
|
||
|
// GetComponent<WaterSource>().hasover = info.hasover;
|
||
|
GetComponent<WaterSource>().totalFlow = info.TotalFlow;
|
||
|
GetComponent<WaterSource>().AllUserWater = info.AllUserWater;
|
||
|
GetComponent<WaterSource>().AllUserFoam = info.AllUserFoam;
|
||
|
if (GetComponent<TruckMessage>())
|
||
|
{
|
||
|
if (info.AllUserWater > GetComponent<WaterSource>().TotalWater)
|
||
|
{
|
||
|
GetComponent<WaterSource>().AllUserWater = GetComponent<WaterSource>().TotalWater;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|