Example #1
0
    public override void OnViewMessage(NetDataReader reader)
    {
        base.OnViewMessage(reader);

        var protocol = reader.GetProtocol();

        switch (protocol)
        {
        case Protocol.Attack:
        {
            _animator.SetTrigger("Attack");
        }
        break;

        case Protocol.Move:
        {
            transform.localPosition = reader.ReadVector3();
            _moveDir = reader.ReadVector3();
        }
        break;
        }
    }