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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user