Flying Bird Puzzle section Complete.
Finished with the logic of the flying bird step.
This commit is contained in:
@@ -8,6 +8,7 @@ public class SoundGenerator : MonoBehaviour
|
||||
[SerializeField] private AudioClip enterSound;
|
||||
[SerializeField] private AudioSource audioSource;
|
||||
[SerializeField] private StateMachine soundBirdSMRef;
|
||||
[SerializeField] private soundBird_CanFly soundbirdHearingCheck;
|
||||
|
||||
private bool playerInside = false;
|
||||
private SpriteRenderer spriteRenderer;
|
||||
@@ -35,12 +36,11 @@ public class SoundGenerator : MonoBehaviour
|
||||
{
|
||||
audioSource.PlayOneShot(enterSound);
|
||||
}
|
||||
if (soundBirdSMRef != null && soundBirdSMRef.currentState.name == "SoundBird")
|
||||
if (soundBirdSMRef != null && soundBirdSMRef.currentState.name == "SoundBird" && soundbirdHearingCheck.canFly == true)
|
||||
{
|
||||
soundBirdSMRef.ChangeState("SoundBirdTakeoff"); // Replace with your actual method/state
|
||||
soundBirdSMRef.ChangeState("SoundBirdTakeoff");
|
||||
|
||||
}
|
||||
// Play sound and change animation/state here if needed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ public class SoundGenerator : MonoBehaviour
|
||||
{
|
||||
spriteRenderer.sprite = exitSprite;
|
||||
}
|
||||
// Reset animation/state here if needed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user