Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyUp(KeyCode.Alpha1))
     {
         StartCoroutine(Fade.TransitionIn(Vector3.zero));
     }
     else if (Input.GetKeyUp(KeyCode.Alpha2))
     {
         StartCoroutine(Fade.TransitionOut(Vector3.zero));
     }
     else if (Input.GetKeyUp(KeyCode.Alpha3))
     {
         StartCoroutine(Pixelate.TransitionIn(Vector3.zero));
     }
     else if (Input.GetKeyUp(KeyCode.Alpha4))
     {
         StartCoroutine(Pixelate.TransitionOut(Vector3.zero));
     }
     else if (Input.GetKeyUp(KeyCode.Alpha5))
     {
         StartCoroutine(Iris.TransitionIn(Vector3.zero));
     }
     else if (Input.GetKeyUp(KeyCode.Alpha6))
     {
         StartCoroutine(Iris.TransitionOut(Vector3.zero));
     }
 }
    IEnumerator SwitchingScene(TransitionType transitionType, string sceneName)
    {
        ScreenTransition st = null;

        for (int i = 0; i < BattleManager.hpm.activePartyMembers.Count; i++)
        {
            BattleManager.hpm.activePartyMembers[i].gameObject.GetComponent <GridController>().canMove = false;
        }

        switch (transitionType)
        {
        case (TransitionType.FADE):
            st = fadeTransition;
            break;

        case (TransitionType.FOURSIDE):
            st = fsTransition;
            break;

        default:
            Debug.Log("Invalid Scene Name!");
            break;
        }


        st.enabled       = true;
        st.transitioning = true;
        while (st.TransitionIn())
        {
            yield return(null);
        }
        Debug.Log("Scene trans in");
        if (sceneName != null)
        {
            SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
        }
        for (int i = 1; i < BattleManager.hpm.activePartyMembers.Count; i++)
        {
            BattleManager.hpm.activePartyMembers[i].transform.position = BattleManager.hpm.activePartyMembers[0].transform.position;
        }
        yield return(new WaitForSeconds(1));

        while (st.TransitionOut())
        {
            yield return(null);
        }
        for (int i = 0; i < BattleManager.hpm.activePartyMembers.Count; i++)
        {
            BattleManager.hpm.activePartyMembers[i].gameObject.GetComponent <GridController>().inputList.Clear();
            BattleManager.hpm.activePartyMembers[i].gameObject.GetComponent <GridController>().canMove = true;
        }
        enabled = false;

        Debug.Log("Scene switch successful");
    }
Example #3
0
    IEnumerator SwitchingScenes(string sceneName)
    {
        isSwitching = true;
        st.enabled  = true;

        while (st.TransitionIn())
        {
            yield return(null);
        }

        if (sceneName != "")
        {
            SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
        }

        while (st.TransitionOut())
        {
            yield return(null);
        }

        isSwitching = false;
    }