Ejemplo n.º 1
0
    // Public Functions

    public void moveHook(Vector3 direction)
    {
        RaycastHit hit;

        if (!Physics.Raycast(transform.position, direction, out hit, 1))
        {
            stateManager.decreaseTimerForHookMove();
            transform.position = Vector3.Lerp(transform.position, transform.position + direction, 1);
            soundPlayer.playHookMoveSound();
            StartCoroutine(fishManager.moveAllFishes());
        }
        else if (hit.collider.CompareTag("Fish"))
        {
            stateManager.decreaseTimerForHookMove();
            transform.position = Vector3.Lerp(transform.position, transform.position + direction, 1);
            soundPlayer.playHookMoveSound();
            StartCoroutine(fishManager.moveAllFishes());
        }
    }