Fixed SoundBird Bug

This commit is contained in:
2025-11-04 16:26:33 +01:00
parent aabe023c64
commit be22d09e39
3 changed files with 29 additions and 6 deletions

View File

@@ -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");
}
}
}