Ejemplo n.º 1
0
    public void GhostDied()
    {
        ghostCount -= 1;

        if (ghostCount == 0) // Stage 2 complete
        {
            Debug.Log("stage 2 complete");
            blackScreen.GetComponent <UIImageFader>().FadeIn(3f);
            beforeEndingTimer.Start(3f + 1f);
        }
    }
Ejemplo n.º 2
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.name == "TorchlightCollider" && tag != "GhostRage")
        {
            rigidbody.AddForce((-direction * ReceivedAttackForce), ForceMode.Impulse);
        }
        else if (collider.name == "CampfireTrigger" && tag != "GhostRage")
        {
            Vector3 cv  = campfire.transform.position;
            Vector3 dir = cv - transform.position;
            dir.Normalize();

            runAwayDirection = dir;
            runAwayTimeProgress.Start(5f);
            trackingPlayer = false;
        }
    }
Ejemplo n.º 3
0
    void Update()
    {
        if (!wasTutorialHidden)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                wasTutorialHidden = true;
                blackScreen.GetComponent <UIImageFader>().FadeOut(10f);
                tutorialTitle.GetComponent <UITextFader>().FadeOut(10f);
                tutorialText.GetComponent <UITextFader>().FadeOut(10f);

                // Kick off the gameplay
                dialogSystem.ChangeActive(true, "Intro");
            }
        }

        if (deathScreenTimer.IsDone())
        {
            player.GetComponent <Player>().Respawn();
            deathText.GetComponent <UITextFader>().FadeOut(2f);
            blackScreen.GetComponent <UIImageFader>().FadeOut(2f);
            deathScreenTimer.Reset();
        }

        if (dialogSystem.HasFinished("Intro"))
        {
            postIntroText.GetComponent <UITextFader>().FadeIn(2f);
            postIntroTimer.Start(7f);
        }
        if (postIntroTimer.IsDone())
        {
            postIntroText.GetComponent <UITextFader>().FadeOut(2f);
            postIntroTimer.Reset();
        }

        if (dialogSystem.HasFinished("BlueFire"))
        {
            // Activate new ghosts
            foreach (GameObject g in rageGhosts)
            {
                g.SetActive(true);
            }
            Debug.Log("Ghosts to kill " + ghostCount);
        }

        // Ending sequence
        noise.volume = Mathf.Lerp(0.05f, 0f, ending ? 1f : beforeEndingTimer.GetProgress());
        if (beforeEndingTimer.IsDone())
        {
            // At this point the screen is black
            GameObject.Find("Sun").GetComponent <Light>().intensity = 1f;
            GameObject.Find("Campfire/Point Light").SetActive(false);
            GameObject.Find("Campfire/Particle System").SetActive(false);
            player.GetComponent <Player>().Respawn();
            player.GetComponent <Player>().MovementEnabled = false;

            dialogSystem.ChangeActive(true, "Ending");

            beforeEndingTimer.Reset();
            blackScreen.GetComponent <UIImageFader>().FadeOut(3f);

            ending = true;
        }

        if (dialogSystem.HasFinished("Ending"))
        {
            player.GetComponent <Player>().MovementEnabled = false;
            blackScreen.GetComponent <UIImageFader>().FadeIn(3f);
            thankYouText.GetComponent <UITextFader>().FadeIn(3f);
        }
    }
Ejemplo n.º 4
0
 public void PlayerDies()
 {
     blackScreen.GetComponent <UIImageFader>().FadeIn(3f);
     deathText.GetComponent <UITextFader>().FadeIn(3f);
     deathScreenTimer.Start(3f + 3f);
 }
Ejemplo n.º 5
0
 public void ChangeColor(Color targetColor, float duration)
 {
     this.targetColor = targetColor;
     timeProgress.Start(duration);
 }
Ejemplo n.º 6
0
 public void FadeIn(float duration)
 {
     TargetAlpha = 1f;
     timeProgress.Start(duration);
 }