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.
53 lines
1.7 KiB
53 lines
1.7 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using AX.Network.Protocols; |
|
using UnityEngine; |
|
using AX.Serialization; |
|
|
|
public class LEAK1_FIRE_FIGHT_SYNC : NetworkMessageBehaviour |
|
{ |
|
private Transform FireBottom; |
|
private Transform Smoke; |
|
private Transform Fire8; |
|
|
|
ParticleSystem.EmissionModule firebuttomemiss; |
|
ParticleSystem.EmissionModule smokeemiss; |
|
ParticleSystem.EmissionModule fire8emiss; |
|
|
|
void Start() |
|
{ |
|
FireBottom = transform.Find("FireBottom"); |
|
Smoke = FireBottom.Find("smoke (1)"); |
|
Fire8 = FireBottom.Find("fire (8)"); |
|
firebuttomemiss = FireBottom.GetComponent<ParticleSystem>().emission; |
|
smokeemiss = Smoke.GetComponent<ParticleSystem>().emission; |
|
fire8emiss = Fire8.GetComponent<ParticleSystem>().emission; |
|
} |
|
protected override void Execute(BinaryMessage message) |
|
{ |
|
|
|
InputHistory.Instance.RegisterInputHistory(message); |
|
|
|
var info = message.Body.Deserialize<Leak1FireFightSyncData>(); |
|
// var sender = info.SendUserID; |
|
if (InputManager.Instance) |
|
{ |
|
if (CurrentUserInfo.mySelf.Id != info.SendUserID) |
|
{ |
|
if (GetComponent<BaseGameObjInfo>().gameObjID == info.gameObjID) |
|
{ |
|
firebuttomemiss.rateOverTime = info.FireButtomRate; |
|
fire8emiss.rateOverTime = info.Fire8Rate; |
|
smokeemiss.rateOverTime = info.Smokerate; |
|
|
|
|
|
if (info.FireButtomRate<0&&info.Smokerate<0) |
|
{ |
|
EntitiesManager.Instance.DeleteObj(gameObject); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|