Esempio n. 1
0
    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);
    }
Esempio n. 2
0
 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());
 }
Esempio n. 3
0
 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());
 }