diff --git a/Assets/Dialogue/Anne Lise/AnaLiseInBushDDialogue.dialoguegraph b/Assets/Dialogue/Anne Lise/AnaLiseInBushDDialogue.dialoguegraph index 84d0cdd7..32954319 100644 --- a/Assets/Dialogue/Anne Lise/AnaLiseInBushDDialogue.dialoguegraph +++ b/Assets/Dialogue/Anne Lise/AnaLiseInBushDDialogue.dialoguegraph @@ -492,7 +492,7 @@ MonoBehaviour: m_Value: _contentType: 1 _text: - _image: {fileID: -5941552768301239376, guid: 300528d856c15824989bade57a7e04e4, type: 3} + _image: {fileID: -8203946286166492161, guid: 6cb19dd8ad625c543abe9aa233cd676d, type: 3} _audio: {fileID: 8300000, guid: 69b3ae7103725d843b45b91cd31c0a4a, type: 3} - rid: 4008004961314799901 type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} @@ -504,7 +504,7 @@ MonoBehaviour: m_Value: _contentType: 1 _text: - _image: {fileID: -5941552768301239376, guid: 300528d856c15824989bade57a7e04e4, type: 3} + _image: {fileID: -8203946286166492161, guid: 6cb19dd8ad625c543abe9aa233cd676d, type: 3} _audio: {fileID: 8300000, guid: 9cd155aba23b8ca4394ea3ecec4a0792, type: 3} - rid: 4008004961314799903 type: {class: 'Constant`1[[System.Boolean, mscorlib]]', ns: Unity.GraphToolkit.Editor, asm: Unity.GraphToolkit.Internal.Editor} diff --git a/Assets/Scenes/Levels/Quarry.unity b/Assets/Scenes/Levels/Quarry.unity index b00944d1..15d065da 100644 --- a/Assets/Scenes/Levels/Quarry.unity +++ b/Assets/Scenes/Levels/Quarry.unity @@ -410,6 +410,7 @@ MonoBehaviour: normalOrthoSize: 15 transitionDuration: 0.5 flyingBehaviour: {fileID: 1790656766} + takeOffBehaviour: {fileID: 1252594312} birdStateMachine: {fileID: 368957769} --- !u!4 &12163667 Transform: @@ -449614,11 +449615,11 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8361739881193827101, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: m_LocalPosition.x - value: 7.439999 + value: 7.4399986 objectReference: {fileID: 0} - target: {fileID: 8361739881193827101, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: m_LocalPosition.y - value: 11.47 + value: 11.469999 objectReference: {fileID: 0} - target: {fileID: 9074453772172382270, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} propertyPath: chaseSpline @@ -452548,6 +452549,7 @@ MonoBehaviour: SoundBirdObject: {fileID: 277331775} flightDuration: 3 flightDelay: 0.46 + flyingBehaviour: {fileID: 1790656766} audioSource: {fileID: 368957773} --- !u!1001 &1256486233 PrefabInstance: @@ -470680,6 +470682,10 @@ PrefabInstance: propertyPath: m_Name value: AnneLiseBushA objectReference: {fileID: 0} + - target: {fileID: 7775613298932159589, guid: fc42c3bdda1c86d49b0bf80c28e5d372, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} - target: {fileID: 7775613298932159589, guid: fc42c3bdda1c86d49b0bf80c28e5d372, type: 3} propertyPath: m_LocalPosition.x value: 54.84 @@ -471062,6 +471068,10 @@ PrefabInstance: propertyPath: birdGameStats value: objectReference: {fileID: 708284665} + - target: {fileID: 4380364850094877018, guid: f15bf96f88d21b14191ad80200912775, type: 3} + propertyPath: reactionClipToPlay + value: + objectReference: {fileID: 8300000, guid: 2419f718f73907749a2940ac09d65238, type: 3} - target: {fileID: 6843886318979936936, guid: f15bf96f88d21b14191ad80200912775, type: 3} propertyPath: m_LocalPosition.x value: -27.09 @@ -471623,6 +471633,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 123989455} m_Modifications: + - target: {fileID: 160486722158287766, guid: 3fa494ec083cbe54a86c3a1b107a90c0, type: 3} + propertyPath: m_LocalScale.x + value: 1 + objectReference: {fileID: 0} - target: {fileID: 160486722158287766, guid: 3fa494ec083cbe54a86c3a1b107a90c0, type: 3} propertyPath: m_LocalPosition.x value: -71.04 @@ -472151,6 +472165,7 @@ SceneRoots: - {fileID: 965792696} - {fileID: 764788851} - {fileID: 7638743433705074736} + - {fileID: 1640143969} - {fileID: 2926576032425091693} - {fileID: 2056506545} - {fileID: 2115320175} @@ -472171,4 +472186,3 @@ SceneRoots: - {fileID: 1374202465} - {fileID: 519077570} - {fileID: 708284666} - - {fileID: 1640143969} diff --git a/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/cameraSwitcher.cs b/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/cameraSwitcher.cs index e64307c4..0fddca55 100644 --- a/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/cameraSwitcher.cs +++ b/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/cameraSwitcher.cs @@ -11,6 +11,7 @@ public class cameraSwitcher : MonoBehaviour [SerializeField] private float normalOrthoSize = 20f; [SerializeField] private float transitionDuration = 0.5f; // Duration of the transition [SerializeField] private soundBird_FlyingBehaviour flyingBehaviour; + [SerializeField] private soundBird_TakeOffBehaviour takeOffBehaviour; // New reference [SerializeField] private StateMachine birdStateMachine; private int playerInsideCount = 0; @@ -38,12 +39,16 @@ public class cameraSwitcher : MonoBehaviour { if (zoomCoroutine != null) StopCoroutine(zoomCoroutine); zoomCoroutine = StartCoroutine(SmoothOrthoSize(virtualCamera, normalOrthoSize, transitionDuration)); - // Fix: Check if currentState's name is "SoundBirdFlyAround" and flyingBehaviour is not null - if (birdStateMachine.currentState != null && - birdStateMachine.currentState.name == "SoundBirdFlyAround" && - flyingBehaviour != null) + if (birdStateMachine.currentState != null) { - flyingBehaviour.StartLanding(); + if (birdStateMachine.currentState.name == "SoundBirdFlyAround" && flyingBehaviour != null) + { + flyingBehaviour.StartLanding(); + } + else if (birdStateMachine.currentState.name == "SoundBirdTakeoff" && takeOffBehaviour != null) + { + takeOffBehaviour.StartLanding(); + } } } } diff --git a/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/soundBird_TakeOffBehaviour.cs b/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/soundBird_TakeOffBehaviour.cs index 6eea8f2c..36a1964b 100644 --- a/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/soundBird_TakeOffBehaviour.cs +++ b/Assets/Scripts/DamianExperiments/SoundBirdPuzzleSection/soundBird_TakeOffBehaviour.cs @@ -12,6 +12,7 @@ public class soundBird_TakeOffBehaviour : MonoBehaviour private StateMachine stateMachine; private Animator animator; private TweenBase objectTween; + public soundBird_FlyingBehaviour flyingBehaviour; public AppleAudioSource audioSource; @@ -48,4 +49,19 @@ public class soundBird_TakeOffBehaviour : MonoBehaviour stateMachine.ChangeState("SoundBirdFlyAround"); // Change to the desired state name } } + + // Added for cameraSwitcher + public void StartLanding() + { + if (objectTween != null) + { + objectTween.Cancel(); + } + if (stateMachine != null) + { + flyingBehaviour.midFlightPosition = SoundBirdObject.position; + stateMachine.ChangeState("SoundBirdLanding"); + + } + } } diff --git a/Assets/Scripts/Sound/AppleAudioSource.cs b/Assets/Scripts/Sound/AppleAudioSource.cs index d48ea839..f31b9445 100644 --- a/Assets/Scripts/Sound/AppleAudioSource.cs +++ b/Assets/Scripts/Sound/AppleAudioSource.cs @@ -19,7 +19,7 @@ public class AppleAudioSource : MonoBehaviour public int sourcePriority; // Start is called once before the first execution of Update after the MonoBehaviour is created - void Start() + void OnEnable() { audioSource = GetComponent(); AudioManager.Instance.RegisterNewAudioSource(this); @@ -29,10 +29,6 @@ public class AppleAudioSource : MonoBehaviour } - private void Awake() - { - Start(); - } public void InitializeAudioSource() {