IEnumerator SwitchToSpin() { yield return(new WaitForSeconds(switchToCurveTime)); currentFlyerState = FlyerStates.spin; switchingCoroutine = null; }
IEnumerator SwitchToStraight() { yield return(new WaitForSeconds(switchToStraightTime)); currentFlyerState = FlyerStates.flyStraight; switchingCoroutine = null; }
public override void Start() { base.Start(); currentFlyerState = FlyerStates.flyStraight; rb = GetComponent <Rigidbody>(); rb.drag = 20.0f; switchingCoroutine = StartCoroutine(SwitchToSpin()); circleSwitcher = 0; switchToStraightTime = 2.9f; switchToCurveTime = 2.0f; }