예제 #1
0
 bool OnDeath(DeathBySignal signal)
 {
     switch (ExperienceState)
     {
     case ExperienceState.Gameplay:
         Continue(signal);
         break;
     }
     return(true);
 }
예제 #2
0
    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");
    }
예제 #3
0
    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;
        }
    }