Exemplo n.º 1
0
        public void LoadLevelWithFade(string name)
        {
            if (sound != null)
            {
                sound.Play();
            }
            sceneFader.FadeOut();

            screenToChangeTo = name;
            screenChangeTime = sceneFader.fadeDuration + 0.5f;
        }
Exemplo n.º 2
0
 public void FadeOut()
 {
     if (fadeout)
     {
         fadeInOut.FadeOut();
     }
 }
Exemplo n.º 3
0
 void Update()
 {
     if (allowFade)
     {
         StartCoroutine(m_FadeInOut.FadeOut());
         allowFade = false;
     }
 }
Exemplo n.º 4
0
    public void FadeOut(bool activeState, float time, System.Action action)
    {
        FadeInOut fade = Get <FadeInOut>(UIList.FadeInOut);

        if (fade != null)
        {
            fade.FadeOut(activeState, time, action);
        }
    }
Exemplo n.º 5
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         StartCoroutine(m_Fade.FadeOut());
     }
     else if (Input.GetKeyDown(KeyCode.D))
     {
         StartCoroutine(m_Fade.FadeIn());
     }
 }
    private IEnumerator Hide()
    {
        fadeComponent.FadeOut(fadeDuration);
        yield return(new WaitForSeconds(fadeDuration));

        for (int i = 0; i < renderers.Length; ++i)
        {
            renderers[i].enabled = false;
        }
        activeCoroutine = null;
    }
Exemplo n.º 7
0
    internal IEnumerator StartSecondPhase()
    {
        firstPhase = false;
        state      = State.Changing;
        anim.SetTrigger("Stopping");
        StartCoroutine(SimulateJump(false, 90, 0, 60, 2.25f));
        yield return(new WaitForSeconds(1f));

        List <Transform> crystalsBroken = new List <Transform>();

        foreach (Transform crystal in crystals)
        {
            crystalsBroken.Add(Instantiate(crystalBroken, crystal.position, Quaternion.identity));
            Destroy(crystal.gameObject);
            // Rigidbody c = crystal.gameObject.GetComponent<Rigidbody>();
            // c.isKinematic = false;
            // c.AddForce(new Vector3(Random.Range(-1000, 1000f), -50, Random.Range(-1000, 1000f)));
        }
        yield return(new WaitForSeconds(3));

        // foreach (Transform crystal in crystals)
        //     crystal.gameObject.SetActive(false);

        fade.FadeIn(false);
        yield return(new WaitForSeconds(2.7f));

        foreach (Transform crystal in crystalsBroken)
        {
            int r = Random.Range(0, 5);
            if (r != 3)
            {
                crystal.gameObject.SetActive(false);
            }
        }
        defaultTerrain.gameObject.SetActive(false);
        northTerrain.gameObject.SetActive(true);
        southTerrain.gameObject.SetActive(true);
        northTerrain.position = new Vector3(northTerrain.position.x, 26, northTerrain.position.z);
        player.position       = new Vector3(-50, 1.5f, 0);
        // transform.position = new Vector3(-131, 1.94f, transform.position.z);
        transform.position = new Vector3(tailPoint2.position.x - 20, tailPoint2.position.y + 26, tailPoint2.position.z);
        transform.LookAt(player);
        // transform.position += Vector3.up * 26;
        StartCoroutine(playerScript.CameraShaker2(1, .5f, .5f));
        fade.FadeOut();
        foreach (GameObject skull in skulls)
        {
            Destroy(skull);
        }
        yield return(new WaitForSeconds(2));

        StartCoroutine(JumpOver());
    }
Exemplo n.º 8
0
    public void MoveHome()
    {
        if (m_StaticMember.Days == 10 && EnddImg != null)
        {
            if (m_StaticMember.cntAmountFail >= 4)
            {
                EnddImg.gameObject.SetActive(true);
                EnddImg.color = new Color(1f, 0f, 0f, 0.75f);

                StartCoroutine(Wait());
                Application.Quit();
            }
            else
            {
                EnddImg.gameObject.SetActive(true);
                EnddImg.color = new Color(0f, 0f, 0f, 0.75f);

                StartCoroutine(Wait());
                Application.Quit();
            }
        }

        if (PlayerCtrl.kill < iCheckAll)
        {
            if (m_StaticMember != null)
            {
                m_StaticMember.cntAmountFail++;
            }
        }
        else if (PlayerCtrl.kill == iCheckAll)
        {
            if (m_StaticMember != null)
            {
                m_StaticMember.SizeOfHungryGauge += 10;
            }
        }


        if (m_StaticMember != null)
        {
            m_StaticMember.Buffer = System.Convert.ToByte("0000", 2);
            m_StaticMember.Days++;
        }

        PlayerCtrl.plrhungry = m_StaticMember.SizeOfHungryGauge;
        PlayerCtrl.kill      = 0;
        StartCoroutine(m_FadeInOut.FadeOut());
    }
    private IEnumerator FadeCoroutine(float fadeInDuration, float lifetime, float fadeOutDuration)
    {
        FadeInOut fade = GetComponent <FadeInOut>();

        currentLifeTime = 0f;
        fade.FadeIn(fadeInDuration);
        yield return(new WaitForSeconds(fadeInDuration));

        while (currentLifeTime < lifetime)
        {
            yield return(null);

            currentLifeTime += Time.deltaTime;
        }
        fade.FadeOut(fadeOutDuration);
        yield return(new WaitForSeconds(fadeInDuration));

        Destroy(gameObject);
    }
Exemplo n.º 10
0
 public void StageEnd()
 {
     fadeController.setFadeDuration(2.0f);
     fadeController.StartCoroutine(fadeController.FadeOut());
 }
 public void FadeOut()
 {
     StartCoroutine(fader.FadeOut());
 }
Exemplo n.º 12
0
 private void HideContainer()
 {
     fadeInOut.FadeOut("fast");
 }
Exemplo n.º 13
0
 void DoFadeIn()
 {
     fadeInObject.SetActive(true);
     fadeIn.FadeOut();
 }
Exemplo n.º 14
0
 public void FadeOut()
 {
     fadeInOut.FadeOut();
 }
Exemplo n.º 15
0
 public void OnEnterGame()
 {
     StartCoroutine(m_FadeInOut.FadeOut());
 }
 public void MenuChange()
 {
     buttonHandler.SetAllowButton(false);
     fadeController.setFadeDuration(1f);
     fadeController.StartCoroutine(fadeController.FadeOut());
 }
Exemplo n.º 17
0
 void FadeOut()
 {
     allowButton = false;
     fadeController.setFadeDuration(2.0f);
     fadeController.StartCoroutine(fadeController.FadeOut());
 }
Exemplo n.º 18
0
 private void StartGame()
 {
     pThisButtonAni.Stop();
     StartCoroutine(pScriptTempObject.FadeOut());
 }