2025-09-10 22:17:51 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
using Pixelplacement;
|
|
|
|
|
|
|
|
|
|
public class BirdEyesBehavior : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
private StateMachine statemachine;
|
|
|
|
|
private Animator animator;
|
2025-09-12 12:49:07 +02:00
|
|
|
public bool correctItemIsIn;
|
2025-10-07 13:04:14 +02:00
|
|
|
[SerializeField] private Animator bushAnimator; // Assign in Inspector
|
2025-09-10 22:17:51 +02:00
|
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
statemachine = GetComponent<StateMachine>();
|
|
|
|
|
animator = GetComponentInChildren<Animator>();
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-11 17:03:56 +02:00
|
|
|
public void CorrectItem()
|
2025-09-10 22:17:51 +02:00
|
|
|
{
|
2025-09-12 12:49:07 +02:00
|
|
|
correctItemIsIn = true;
|
2025-09-10 22:17:51 +02:00
|
|
|
animator.SetTrigger("RightGuess");
|
2025-10-09 16:38:27 +02:00
|
|
|
BirdReveal();
|
2025-09-10 22:17:51 +02:00
|
|
|
}
|
|
|
|
|
|
2025-09-11 17:03:56 +02:00
|
|
|
public void IncorrectItem()
|
|
|
|
|
{
|
2025-09-12 12:49:07 +02:00
|
|
|
correctItemIsIn = false;
|
2025-09-11 17:03:56 +02:00
|
|
|
animator.SetTrigger("WrongGuess");
|
|
|
|
|
}
|
|
|
|
|
public void NoItem()
|
2025-09-10 22:17:51 +02:00
|
|
|
{
|
2025-09-11 17:03:56 +02:00
|
|
|
animator.SetTrigger("NoGuess");
|
2025-09-10 22:17:51 +02:00
|
|
|
}
|
2025-09-11 17:03:56 +02:00
|
|
|
public void BirdReveal()
|
2025-09-10 22:17:51 +02:00
|
|
|
{
|
2025-10-08 17:15:20 +02:00
|
|
|
if (bushAnimator != null)
|
|
|
|
|
{
|
|
|
|
|
bushAnimator.SetTrigger("wolterisout");
|
2025-10-09 16:38:27 +02:00
|
|
|
statemachine.ChangeState("BirdSpawned");
|
2025-10-08 17:15:20 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2025-10-07 13:04:14 +02:00
|
|
|
statemachine.ChangeState ("BirdSpawned");
|
2025-09-10 22:17:51 +02:00
|
|
|
}
|
|
|
|
|
}
|