bool OnDeath(DeathBySignal signal) { switch (ExperienceState) { case ExperienceState.Gameplay: Continue(signal); break; } return(true); }
void TransitionGameplayToEnd(DeathBySignal signal) { ChangeState(ExperienceState.End); Sequence mainSequence = DOTween.Sequence(); mainSequence.InsertCallback(0f, () => car.GetComponent <UnityStandardAssets.Vehicles.Car.CarUserControl>().enabled = false); mainSequence.InsertCallback(.2f, () => car.GetComponent <Rigidbody>().velocity = Vector3.zero); mainSequence.InsertCallback(.2f, () => car.GetComponent <Rigidbody>().isKinematic = true); mainSequence.InsertCallback(.5f, () => car.GetComponent <Rigidbody>().isKinematic = false); deathText.text = "KABOOM! YOU DIED BY " + signal.DeathObject.ToUpper(); GameEventMessage.SendEvent("Death"); }
void Continue(DeathBySignal deathSignal = null) { switch (ExperienceState) { case ExperienceState.None: TransitionNoneToStartScreen(); break; case ExperienceState.StartScreen: TransitionStartScreenToGameplay(); break; case ExperienceState.Gameplay: TransitionGameplayToEnd(deathSignal); break; case ExperienceState.End: TransitionEndToNone(); break; } }