Пример #1
0
    //launchTP makes our tp, and lots of other nice stuff
    public IEnumerator LaunchTP()
    {
        PlayerOverworld.instance.PlayerNoMove = true; //Launch TP
        if (GameObject.Find("FadingBlack"))
        {
            if (!noFadeIn)
            {
                float fadeTime = GameObject.Find("FadingBlack").GetComponent <Fading>().BeginFade(1);
                yield return(new WaitForSeconds(fadeTime));
            }
            else
            {
                GameObject.Find("FadingBlack").GetComponent <Fading>().FadeInstant(1);
            }
        }
        EventManager.instance.fadeOutToMap = !noFadeOut;

        if (GlobalControls.isInShop)
        {
            PlayerOverworld.ShowOverworld("Shop");
            GlobalControls.isInShop = false;
        }
        EventManager.instance.SetEventStates();
        GlobalControls.EventData.Clear();

        if (!FileLoader.SceneExists(sceneName))
        {
            UnitaleUtil.DisplayLuaError("Teleportation script", "The map named \"" + sceneName + "\" doesn't exist.");
            yield break;
        }
        if (GlobalControls.nonOWScenes.Contains(sceneName))
        {
            UnitaleUtil.DisplayLuaError("Teleportation script", "Sorry, but \"" + sceneName + "\" is not the name of an overworld scene.");
            yield break;
        }
        SceneManager.LoadScene(sceneName);
        StartCoroutine(TransitionOverworld.GetIntoDaMap("tphandler", new object[] { position, this }));
    }
Пример #2
0
    //launchTP makes our tp, and lots of other nice stuff
    public IEnumerator LaunchTP()
    {
        PlayerOverworld.instance.PlayerNoMove = true; //Launch TP
        switch (GlobalControls.uduu)
        {
        case 0:
            if (gameObject.name == "TP Up Right")
            {
                GlobalControls.uduu++;
            }
            break;

        case 1:
            if (gameObject.name == "TP Down Right")
            {
                GlobalControls.uduu++;
            }
            else
            {
                GlobalControls.uduu = 0;
            }
            break;

        case 2:
            if (gameObject.name == "TP Up Right")
            {
                GlobalControls.uduu++;
            }
            else
            {
                GlobalControls.uduu = 0;
            }
            break;

        case 3:
            if (gameObject.name == "TP Up Right")
            {
                GlobalControls.uduu++;
            }
            else
            {
                GlobalControls.uduu = 0;
            }
            break;

        default:
            if (gameObject.name == "TP Up Left")
            {
                uduu = true;
            }
            GlobalControls.uduu = 0;
            break;
        }
        if (!noFadeIn)
        {
            float fadeTime = GameObject.Find("FadingBlack").GetComponent <Fading>().BeginFade(1);
            yield return(new WaitForSeconds(fadeTime));
        }
        else
        {
            GameObject.Find("FadingBlack").GetComponent <Fading>().FadeInstant(1);
        }
        EventManager.instance.nextFadeTransition = !noFadeOut;

        if (GlobalControls.isInShop)
        {
            PlayerOverworld.ShowOverworld("Shop");
            GlobalControls.isInShop = false;
        }
        EventManager.SetEventStates();
        GlobalControls.EventData.Clear();
        if (uduu)
        {
            uduu      = false;
            sceneName = "Secret";
        }

        if (!FileLoader.SceneExists(sceneName))
        {
            UnitaleUtil.DisplayLuaError("Teleportation script", "The map named \"" + sceneName + "\" doesn't exist.");
            yield break;
        }
        if (GlobalControls.nonOWScenes.Contains(sceneName))
        {
            UnitaleUtil.DisplayLuaError("Teleportation script", "Sorry, but \"" + sceneName + "\" is not the name of an overworld scene.");
            yield break;
        }
        SceneManager.LoadScene(sceneName);
        StartCoroutine(Object.FindObjectOfType <TransitionOverworld>().GetIntoDaMap("tphandler", new object[] { position, this }));
    }