protected override void SetStatus(byte[] pckData, NetworkMessageInfo info) { S2C.RopeStatus pck = new S2C.RopeStatus(); pck.DeserializeFromBytes(pckData); owner = pck.owner; transform.position = pck.position; GetComponent<Rigidbody2D>().velocity = pck.velocity; ropeSource = PlayerManager.Inst.Get(owner); OnSetRopeStuck(pck.stickInfo); }
protected override void BroadcastInit() { S2C.RopeStatus pck = new S2C.RopeStatus(owner, transform.position, GetComponent<Rigidbody2D>().velocity, stickInfo); GetComponent<NetworkView>().RPC("SetStatus", RPCMode.OthersBuffered, pck.SerializeToBytes()); }
protected override void RequestCurrentStatus(NetworkMessageInfo info) { S2C.RopeStatus pck = new S2C.RopeStatus(owner, transform.position, GetComponent<Rigidbody2D>().velocity, stickInfo); Debug.Log("Stick: " + stickInfo); GetComponent<NetworkView>().RPC("SetStatus", info.sender, pck.SerializeToBytes()); }