Esempio n. 1
0
    private Vector3 FacingGridPosition()
    {
        Vector3 pos = GridPosition();

        Helpers.Direction dir = pmc.FacingDirection();

        if (dir == Helpers.Direction.Up)
        {
            pos.y += 1f;
        }
        else if (dir == Helpers.Direction.Down)
        {
            pos.y -= 1f;
        }
        else if (dir == Helpers.Direction.Left)
        {
            pos.x -= 1f;
        }
        else if (dir == Helpers.Direction.Right)
        {
            pos.x += 1f;
        }

        return(pos);
    }
Esempio n. 2
0
    public void Interact(Helpers.Direction fromDirection)
    {
        FaceDirection(fromDirection);

        ConversationController conversationController = FindObjectOfType <ConversationController> ();

        conversationController.StartConversation(name, thingsToSay);
    }
Esempio n. 3
0
 private void FaceDirection(Helpers.Direction fromDirection)
 {
     if (fromDirection == Helpers.Direction.Up)
     {
         spriteRenderer.sprite = upSprite;
     }
     else if (fromDirection == Helpers.Direction.Down)
     {
         spriteRenderer.sprite = downSprite;
     }
     else if (fromDirection == Helpers.Direction.Left)
     {
         spriteRenderer.sprite = horizontalSprite;
         TurnLeft();
     }
     else if (fromDirection == Helpers.Direction.Right)
     {
         spriteRenderer.sprite = horizontalSprite;
         TurnRight();
     }
 }
    public Helpers.Direction FacingDirection()
    {
        Helpers.Direction animationDirection = (Helpers.Direction)animator.GetInteger("direction");

        if (animationDirection == Helpers.Direction.Up)
        {
            return(Helpers.Direction.Up);
        }
        else if (animationDirection == Helpers.Direction.Down)
        {
            return(Helpers.Direction.Down);
        }
        else
        {
            if (sprt.flipX)
            {
                return(Helpers.Direction.Left);
            }
            else
            {
                return(Helpers.Direction.Right);
            }
        }
    }