AnneLise bird counter implemented

This commit is contained in:
2025-10-20 13:57:38 +02:00
parent 6e5a6c049f
commit b49bb43f79
22 changed files with 520 additions and 11 deletions

View File

@@ -5,17 +5,20 @@ using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Events;
using static Input.PlayerTouchController;
using System;
public class TakePhotoState : State
{
public AudioSource audioPlayer;
public AudioResource clipToPlay;
public Transform playerTargetObject;
private GameObject playerCharacter;
private PlayerTouchController playerTouchController;
private Vector3 newPlayerPosition;
public UnityEvent animFlash;
public UnityEvent animStart;
void OnEnable()
{
playerCharacter = GameObject.FindWithTag("Player");
@@ -26,6 +29,7 @@ public class TakePhotoState : State
playerTouchController.InterruptMoveTo();
playerTouchController.MoveToAndNotify(newPlayerPosition);
InputManager.Instance.SetInputMode(InputMode.InputDisabled);
}
// When the player has arrived at the bush do Animator.SetTrigger(Takephoto) and whatevs
@@ -42,9 +46,21 @@ public class TakePhotoState : State
playerTouchController.OnArrivedAtTarget -= PlayerHasArrived;
}
public void PlayPhotoSoundBite()
private void OnDisable()
{
audioPlayer.resource = clipToPlay;
audioPlayer.Play();
playerTouchController.OnArrivedAtTarget -= PlayerHasArrived;
}
public void AnimStarted()
{
animStart.Invoke();
}
public void Flash()
{
animFlash.Invoke();
}
}