예제 #1
0
    private IEnumerator rematerialize()
    {
        isInvulnerable = true;
        yield return(new WaitForSeconds(1f));

        particlesOnMaterialize.GetComponent <ParticleSystem> ().Play();
        yield return(new WaitForSeconds(0.2f));

        float timer          = 0f;
        float timeToDissolve = 1f;

        while (timer < timeToDissolve)
        {
            timer += Time.deltaTime;
            float ratio = timer / timeToDissolve;
            GetComponent <Dissolve>().setDisolution(ratio);
            yield return(null);
        }
        isDematerialized            = false;
        isInvulnerable              = false;
        bpAnimator.gameObject.layer = LayerMask.NameToLayer("Player");
        GameManager.inputController.enableInputController();

        if (GameManager.playerSpaceBody.getClosestPlanet() != null)
        {
            if (GameManager.playerSpaceBody.getClosestPlanet().isPlanetCorrupted())
            {
                PlanetCorrupted pc = (PlanetCorrupted)GameManager.playerSpaceBody.getClosestPlanet();
                if (pc.getPlanetEventsManager() != null)
                {
                    pc.getPlanetEventsManager().playerRespawned();
                }
            }
        }
    }
예제 #2
0
    public void ChargeJump()
    {
        Planet planet = body.getClosestPlanet();

        if (planet != null)
        {
            if (planet.isPlanetCorrupted())
            {
                PlanetCorrupted pc = (PlanetCorrupted)planet;
                if (pc.getPlanetEventsManager() != null)
                {
                    pc.getPlanetEventsManager().chargeSpaceJumping();
                }
            }
        }
        GUIManager.deactivatePlayingGUI();
        bpAnimator.SetBool("isChargingSpaceJumping", true);
        isChargingSpaceJump = true;
        GameManager.mainCamera.GetComponent <CameraFollowingPlayer> ().setObjectiveZCameraOnSpaceJump();
        ParticleSystem particles = particleSystemJumpCharge.GetComponent <ParticleSystem> ();

        particles.Play();
        StopMove();
        ShowArrow();
    }
예제 #3
0
 private void onDieCallEvent()
 {
     if (body.getClosestPlanet() != null)
     {
         if (body.getClosestPlanet().GetComponent <Planet>().isPlanetCorrupted())
         {
             PlanetCorrupted pc = body.getClosestPlanet().GetComponent <PlanetCorrupted>();
             if (pc.getPlanetEventsManager() != null)
             {
                 pc.getPlanetEventsManager().playerDies();
             }
         }
     }
 }
예제 #4
0
    public static void restartGame()
    {
        Planet planet = playerSpaceBody.getClosestPlanet();

        if (planet != null && planet.isPlanetCorrupted())
        {
            PlanetCorrupted planetCorrupted = (PlanetCorrupted)planet;
            if (planetCorrupted.getPlanetEventsManager() != null)
            {
                planetCorrupted.getPlanetEventsManager().onFadeOutAfterDeath();
            }
        }

        rebuildGameFromGameState();

        isGameEnded = false;
        //GUIManager.activatePlayingGUIWithFadeIn();
        GUIManager.fadeOutChangeMenuFadeIn(Menu.None);
    }