Beispiel #1
0
    void CheckCameraLock()
    {
        bool cameraLock = playerInput.CheckCameraLockInput();

        nearestEnemy = GetNearestEnemy();
        animator.SetBool("IsLockedOn", false);
        animator.SetBool("IsLockedOnWithEnemy", false);
        if (cameraLock)
        {
            if (nearestEnemy != null)
            {
                cameraMain.LockCamera(this.transform.rotation.eulerAngles.y, nearestEnemy);
                animator.SetBool("IsLockedOnWithEnemy", true);
            }
            else
            {
                cameraMain.LockCamera(this.transform.rotation.eulerAngles.y);
                animator.SetBool("IsLockedOn", true);
            }
        }
    }