Flying Bird Puzzle section Complete.
Finished with the logic of the flying bird step.
This commit is contained in:
@@ -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() { }
|
||||
|
||||
Reference in New Issue
Block a user