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

@@ -13,7 +13,7 @@ public class soundBird_FlyingBehaviour : MonoBehaviour
private StateMachine stateMachine;
private Animator animator;
private TweenBase objectTween;
private Coroutine cooldownCoroutine;
//private Coroutine cooldownCoroutine;
public Vector3 midFlightPosition;
private float lastX;
@@ -28,7 +28,7 @@ public class soundBird_FlyingBehaviour : MonoBehaviour
private void OnEnable()
{
objectTween = Tween.Spline(FlightSpline, SoundBirdObject, 0, 1, false, flightDuration, flightDelay, Tween.EaseLinear, Tween.LoopType.Loop, HandleTweenStarted, HandleTweenFinished);
cooldownCoroutine = StartCoroutine(CooldownTimer());
//cooldownCoroutine = StartCoroutine(CooldownTimer());
lastX = SoundBirdObject.position.x;
}
@@ -59,12 +59,22 @@ public class soundBird_FlyingBehaviour : MonoBehaviour
}
private System.Collections.IEnumerator CooldownTimer()
/*private System.Collections.IEnumerator CooldownTimer()
{
yield return new WaitForSeconds(cooldownTime);
midFlightPosition = SoundBirdObject.position;
objectTween.Cancel();
stateMachine.ChangeState("SoundBirdLanding");
}*/
public void StartLanding()
{
midFlightPosition = SoundBirdObject.position;
if (objectTween != null)
{
objectTween.Cancel();
}
stateMachine.ChangeState("SoundBirdLanding");
}
void HandleTweenStarted() { }