Flying Bird Puzzle section Complete.

Finished with the logic of the flying bird step.
This commit is contained in:
2025-09-26 15:12:18 +02:00
parent 88e630cbe7
commit 52139cbe64
16 changed files with 9688 additions and 507 deletions

View File

@@ -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
}
}
}