Sound Bird First iteration Complete

Sound generator creates sound, bird gets spooked, is no longer interactable, and comes back after flying around.
This commit is contained in:
2025-09-23 15:51:25 +02:00
parent 4b206b9b2e
commit ceca90e058
15 changed files with 3375 additions and 140 deletions

View File

@@ -1,3 +1,4 @@
using Pixelplacement;
using UnityEngine;
public class SoundGenerator : MonoBehaviour
@@ -6,6 +7,8 @@ public class SoundGenerator : MonoBehaviour
[SerializeField] private Sprite exitSprite;
[SerializeField] private AudioClip enterSound;
[SerializeField] private AudioSource audioSource;
[SerializeField] private StateMachine soundBirdSMRef;
[SerializeField] private soundBird_Spooked_FlyBehaviour spookedBirdRef;
private bool playerInside = false;
private SpriteRenderer spriteRenderer;
@@ -33,6 +36,12 @@ public class SoundGenerator : MonoBehaviour
{
audioSource.PlayOneShot(enterSound);
}
if (soundBirdSMRef != null && soundBirdSMRef.currentState.name == "SoundBird")
{
soundBirdSMRef.ChangeState("SoundBirdSpooked"); // Replace with your actual method/state
spookedBirdRef.initiateTweenSpline();
}
// Play sound and change animation/state here if needed
}
}