private void ChangeDirection()
        {
            Vector2 dir = (Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition) - transform.position).normalized;

            if (!EventSystem.current.IsPointerOverGameObject() && playerMove.allowInput)
            {
                playerSprites.ChangePlayerDirection(Orientation.From(dir));
            }
        }
示例#2
0
    private void ChangeDirection()
    {
        Vector3 playerPos;

        if (playerMove.isGhost)
        {
            playerPos = PlayerManager.PlayerScript.ghost.transform.position;
        }
        else
        {
            playerPos = transform.position;
        }

        Vector2 dir = (Camera.main.ScreenToWorldPoint(UnityEngine.Input.mousePosition) - playerPos).normalized;

        if (!EventSystem.current.IsPointerOverGameObject() && playerMove.allowInput)
        {
            playerSprites.ChangePlayerDirection(Orientation.From(dir));
        }
    }
示例#3
0
 private void OnRotation(RotationOffset fromCurrent)
 {
     playerSprites.ChangePlayerDirection(fromCurrent);
 }