Esempio n. 1
0
    public static void LoadScene(Ref.SceneType sceneToLoad)
    {
        MySceneChangeHook mySceneChangeHook = MyHookSystem.executeHook <MySceneChangeHook>(new MySceneChangeHook(Ref.lastScene, sceneToLoad));
        bool flag = mySceneChangeHook.isCanceled();

        if (!flag)
        {
            sceneToLoad = mySceneChangeHook.newScene;
            Ref.SceneType current = Ref.lastScene;
            Ref.lastScene = Ref.currentScene;
            SceneManager.LoadScene(sceneToLoad.ToString(), LoadSceneMode.Single);
            MyHookSystem.executeHook <MySceneChangedHook>(new MySceneChangedHook(current, sceneToLoad));
        }
    }
Esempio n. 2
0
    public static void LoadScene(Ref.SceneType sceneToLoad)
    {
        MySceneChangeHook res = MyHookSystem.executeHook <MySceneChangeHook>(new MySceneChangeHook(Ref.lastScene, sceneToLoad));

        if (res.isCanceled())
        {
            return;
        }
        sceneToLoad = res.newScene;
        Ref.SceneType oldScene = Ref.lastScene;
        Ref.lastScene = Ref.currentScene;
        SceneManager.LoadScene(sceneToLoad.ToString(), LoadSceneMode.Single);
        MyHookSystem.executeHook <MySceneChangedHook>(new MySceneChangedHook(oldScene, sceneToLoad));
    }