示例#1
0
    IEnumerator LoadGameOver(Unity.LEGO.Game.DeathEvent evt)
    {
        Destroy(GameObject.Instantiate(deathEffect, evt.player.transform.position, evt.player.transform.rotation), 2f);
        yield return(new WaitForSeconds(2f));

        SceneManager.LoadScene("GameOver");
    }
示例#2
0
    IEnumerator RespawnCoroutine(Unity.LEGO.Game.DeathEvent evt)
    {
        Destroy(GameObject.Instantiate(deathEffect, evt.player.transform.position, evt.player.transform.rotation), 2f);
        yield return(new WaitForSeconds(respawnTime));

        evt.player.GetComponent <HealthController>().OnRespawn();
        evt.player.GetComponent <Unity.LEGO.Minifig.MinifigController>().Respawn(LastSafezone.GetLastSafePosition());
    }
示例#3
0
 void OnPlayerDeath(Unity.LEGO.Game.DeathEvent evt)
 {
     if (oneLife)
     {
         // Trigger game win event
         Unity.LEGO.Game.Events.GameOverEvent.Win = true;
         Unity.LEGO.Game.EventManager.Broadcast(Unity.LEGO.Game.Events.GameOverEvent);
         StartCoroutine(LoadGameOver(evt));
     }
     else
     {
         StartCoroutine(RespawnCoroutine(evt));
     }
 }