コード例 #1
0
    void DoFacing()
    {
        Vector3 facingVector = player.transform.position - this.transform.position;

        if (Mathf.Abs(facingVector.x) > Mathf.Abs(facingVector.y))
        {
            if (facingVector.x > 0)
            {
                facing = EntityFacing.Right;
            }
            else
            {
                facing = EntityFacing.Left;
            }
        }
        else
        {
            if (facingVector.y > 0)
            {
                facing = EntityFacing.Up;
            }
            else
            {
                facing = EntityFacing.Down;
            }
        }

        animator.Play("skeletonwalk" + facing.ToString().ToLower());
    }
コード例 #2
0
    void DoFacing()
    {
        Vector3      facingVector = player.transform.position - this.transform.position;
        EntityFacing facing       = Facing.DirectionToFacing(facingVector);

        animator.Play("ArcherWalk" + facing.ToString());
    }
コード例 #3
0
 void DoFacing()
 {
     animator.Play("OctorokWalk" + facing.ToString());
 }