Beispiel #1
0
    protected virtual void RequestCurrentStatus(NetworkMessageInfo info)
    {
        S2C.ProjectileStatus pck = new S2C.ProjectileStatus(owner, transform.position, GetComponent<Rigidbody2D>().velocity);

        GetComponent<NetworkView>().RPC("SetStatus", info.sender, pck.SerializeToBytes());
    }
Beispiel #2
0
    protected virtual void SetStatus(byte[] pckData, NetworkMessageInfo info)
    {
        S2C.ProjectileStatus pck = new S2C.ProjectileStatus();
        pck.DeserializeFromBytes(pckData);

        owner = pck.owner;
        transform.position = pck.position;
        GetComponent<Rigidbody2D>().velocity = pck.velocity;
    }
Beispiel #3
0
    protected virtual void BroadcastInit()
    {
        S2C.ProjectileStatus pck = new S2C.ProjectileStatus(owner, transform.position, GetComponent<Rigidbody2D>().velocity);

        GetComponent<NetworkView>().RPC("SetStatus", RPCMode.OthersBuffered, pck.SerializeToBytes());
    }