AnneLise bird counter implemented
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user