public void RecvHealth(byte[] pckData, NetworkMessageInfo info) { //ServerCheck S2C.SetStructureHealth pck = new S2C.SetStructureHealth(); pck.DeserializeFromBytes(pckData); TileManager.Inst.Get(pck.m_ID).RecvHealth(pck); }
void RecvHealth(byte[] pckData, NetworkMessageInfo info) { //ServerCheck S2C.SetStructureHealth pck = new S2C.SetStructureHealth(); pck.DeserializeFromBytes(pckData); BuildingManager.Inst.Get(pck.m_ID).RecvHealth(pck); if (pck.m_health == 0) Debug.Log("Health Time : " + Network.time); }
public void BroadcastHealth(ushort ID, short health, DestroyReason reason) { S2C.SetStructureHealth pck = new S2C.SetStructureHealth(ID, health, reason); GetComponent<NetworkView>().RPC("RecvHealth", RPCMode.Others, pck.SerializeToBytes()); }