Beispiel #1
0
 private void SceneLoaded(UnityEngine.SceneManagement.Scene _scene, UnityEngine.SceneManagement.LoadSceneMode _loadSceneMode)
 {
     AssignOverrides();
 }
Beispiel #2
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene,
                    UnityEngine.SceneManagement.LoadSceneMode loadingMode)
 {
     this.CalledOnLevelWasLoaded(scene.buildIndex);
 }
Beispiel #3
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     LightningBolt.ClearCache();
 }
Beispiel #4
0
 private void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     ui.SetActive(!PhotonNetwork.inRoom);
 }
Beispiel #5
0
 static void OnEditorSceneOpened(UnityEngine.SceneManagement.Scene scene, OpenSceneMode mode)
 {
     CheckSceneStatus();
 }
 public static void SaveScene()
 {
     UnityEngine.SceneManagement.Scene currentScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
     EditorSceneManager.SaveScene(currentScene);
 }
Beispiel #7
0
 /////////////////////////////////////////
 static void OnSceneOpened(UnityScene scene, OpenSceneMode mode)
 {
     CreateHashTable();
 }
Beispiel #8
0
 private void Init(UnityEngine.SceneManagement.Scene inScene, int index)
 {
     Scene = inScene;
     Index = index;
     Name  = inScene.name;
 }
Beispiel #9
0
 public static extern bool BakeAsync(Scene scene);
Beispiel #10
0
 public static extern bool Bake(Scene scene);
Beispiel #11
0
 private void SceneManagerOnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode)
 {
     SceneLoadedHandler(scene.buildIndex);
 }
        public void OnActiveSceneChanged(UnityEngine.SceneManagement.Scene prevScene, UnityEngine.SceneManagement.Scene nextScene)
        {
            Logger.log?.Debug($"{name}: LoadingScene({nextScene.name} : {nextScene.path})");

            if (StabilityPeriodActive)                    // because of fast restart/exit combined with long StabilityDurationCheck
            {
                CancelInvoke("StopStabilityCheckPeriod"); // Cancel previous session's StopStabilityCheckPeriod
            }
            if (nextScene.name == "GameCore")
            {
                IsMultiplayer = (Resources.FindObjectsOfTypeAll <MultiplayerController>().LastOrDefault() != null);
                if (IsMultiplayer)
                {
                    Logger.log?.Info($"Starting Multiplayer play session, AutoPauseStealth will NOT pause the game !");
                    return;
                }

                // LastOrDefault() because BeatSaber don't know how to clean and keep every objects created per song play ...
                // Lazy fix => LastOrDefault() should assure to grab SinglePlayer related objects ...
                // Note : Counter++ setting page load a """level""" (but without any ScoreController)
                ScoreController = Resources.FindObjectsOfTypeAll <ScoreController>().LastOrDefault();
                if (ScoreController == null)
                {
                    Logger.log?.Warn("Couldn't find ScoreController object, probably not a vanilla GameCore scene");
                    return;
                }

                SongController = Resources.FindObjectsOfTypeAll <SongController>().LastOrDefault();
                if (SongController == null)
                {
                    Logger.log?.Warn("Couldn't find SongController object, probably not a vanilla GameCore scene");
                    return;
                }

                RestartController = Resources.FindObjectsOfTypeAll <StandardLevelRestartController>().LastOrDefault();
                if (RestartController == null)
                {
                    RestartController = Resources.FindObjectsOfTypeAll <MissionLevelRestartController>().LastOrDefault();
                    if (RestartController == null)
                    {
                        RestartController = Resources.FindObjectsOfTypeAll <TutorialRestartController>().LastOrDefault();
                        if (RestartController == null)
                        {
                            Logger.log?.Warn("Couldn't find RestartController object, probably not a vanilla GameCore scene");
                            return;
                        }
                    }
                }

                StabilityPeriodActive = true;
                b_inGame         = true;
                f_stabilityTimer = 0.0f;

                Invoke("StopStabilityCheckPeriod", PluginSettings.Instance.MaxWaitingTime);
            }
            else
            {
                b_inGame = false;
            }
        }
Beispiel #13
0
 private void SceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     LevelStart();
 }
Beispiel #14
0
 private static void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene oldScene, UnityEngine.SceneManagement.Scene newScene)
 {
 }
        static void BuildPlayer()
        {
            if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android)
            {
                Debug.LogError("请选择 Android 平台后,再次打包!!!");
                return;
            }

            // 将 meta 设置为 text 模式
            if (SerializationMode.ForceText != EditorSettings.serializationMode)
            {
                Debug.LogError("请将 Edit->Project Setting->Asset Serialization->Mode 设置项设置为 ForceText");
                return;
                //EditorSettings.serializationMode = SerializationMode.ForceText;
            }

            string gplayConfigPath = Application.streamingAssetsPath + "/GPlayConfig.xml";

            if (File.Exists(gplayConfigPath))
            {
                File.Delete(gplayConfigPath);
            }

            #region 得到需要打包的场景
            List <string> buildScenes = new List <string>();
            foreach (var buildScene in EditorBuildSettings.scenes)
            {
                if (buildScene.enabled)
                {
                    buildScenes.Add(buildScene.path);
                }
            }

            if (buildScenes.Count == 0)
            {
                UnityEngine.SceneManagement.Scene activeScene = EditorSceneManager.GetActiveScene();
                if (string.IsNullOrEmpty(activeScene.path))
                {
                    //EditorApplication.ExecuteMenuItem("File/BuildSettings");
                    EditorWindow.GetWindow(ReflectionUtility.GetType("UnityEditor.BuildPlayerWindow"), true, "Build Settings");
                    Debug.Log("请在BuildSetting中添加要打包的场景");
                    return;
                }
                else
                {
                    buildScenes.Add(activeScene.path);
                }
            }
            #endregion

            #region 生成配置文件
            if (!Directory.Exists(Application.streamingAssetsPath))
            {
                Directory.CreateDirectory(Application.streamingAssetsPath);
            }

            var gplayConfig = new GPlayConfig()
            {
                unityVersion = Application.unityVersion
            };

            // 生成资源配置信息
            gplayConfig.resConfig = ResourceConfigUtility.Generate(buildScenes);

            SerializeUtility.XmlSerializeToFile <GPlayConfig>(gplayConfig, Application.streamingAssetsPath + "/GPlayConfig.xml");

            AssetDatabase.Refresh();
            //processWindow.Close();
            #endregion

            //// 设置为非开发模式
            //EditorUserBuildSettings.development = false;
            //ReflectionUtility.BuildPlayerWithDefaultSettings(true, BuildOptions.ShowBuiltPlayer);

            //// 删除配置文件
            //AssetDatabase.DeleteAsset("Assets/StreamingAssets/GPlayConfig.xml");

            #region comment
            //string path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", "");
            //path = Path.Combine(path, GetBuildFileName());

            //BuildOptions options = BuildOptions.None;
            //if (EditorUserBuildSettings.allowDebugging && EditorUserBuildSettings.development)
            //    options |= BuildOptions.AllowDebugging;
            //if (EditorUserBuildSettings.development)
            //    options |= BuildOptions.Development;
            //if (EditorUserBuildSettings.connectProfiler)
            //    options |= BuildOptions.ConnectWithProfiler;

            //BuildPipeline.BuildPlayer(buildScenes.ToArray(), path, EditorUserBuildSettings.activeBuildTarget, options);
            #endregion
        }
Beispiel #16
0
 public SceneWrapper(UnityEngine.SceneManagement.Scene inScene, int index)
 {
     Init(inScene, index);
 }
Beispiel #17
0
 private void BuildPoints(ParticleManager gm)
 {
     gm.system.CreateFromDictionary(pointsList.CurrDict);
     poolScene   = gm.system.factory.poolScene;
     builtPoints = true;
 }
Beispiel #18
0
 private void SceneManagerSceneLoaded(UnityEngine.SceneManagement.Scene s, UnityEngine.SceneManagement.LoadSceneMode m)
 {
     tweens.Clear();
 }
Beispiel #19
0
 private void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     SceneChanged = true;
 }
 public void OnProcessScene(UnityEngine.SceneManagement.Scene scene, BuildReport report)
 {
     m_method.Invoke(null, null);
 }
Beispiel #21
0
        /// <summary>
        /// Unity 5.4+ scene changed callback
        /// </summary>
#if UNITY_5_4_OR_NEWER
        void OnSceneFinishedLoading(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
        {
            _newSceneLoaded = true;
        }
 /**
  * <summary>Gets a Behaviour that is in the same scene as a given GameObject.</summary>
  * <param name = "_gameObject">The GameObject in the scene</param>
  * <returns>The Behaviour that is in the same scene as the given GameObject</returns>
  */
 public static T GetOwnSceneInstance <T> (GameObject gameObject) where T : Behaviour
 {
     UnityEngine.SceneManagement.Scene ownScene = gameObject.scene;
     return(GetSceneInstance <T> (ownScene));
 }
Beispiel #23
0
        static void WriteBackInstance(CSHotFix.Runtime.Enviorment.AppDomain __domain, StackObject *ptr_of_this_method, IList <object> __mStack, ref UnityEngine.SceneManagement.Scene instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch (ptr_of_this_method->ObjectType)
            {
            case ObjectTypes.Object:
            {
                __mStack[ptr_of_this_method->Value] = instance_of_this_method;
            }
            break;

            case ObjectTypes.FieldReference:
            {
                var ___obj = __mStack[ptr_of_this_method->Value];
                if (___obj is ILTypeInstance)
                {
                    ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    var t = __domain.GetType(___obj.GetType()) as CLRType;
                    t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.StaticFieldReference:
            {
                var t = __domain.GetType(ptr_of_this_method->Value);
                if (t is ILType)
                {
                    ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                }
                else
                {
                    ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                }
            }
            break;

            case ObjectTypes.ArrayReference:
            {
                var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.SceneManagement.Scene[];
                instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
            }
            break;
            }
        }
Beispiel #24
0
 private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1)
 {
     LevelWasLoaded();
 }
Beispiel #25
0
 private void SceneManagerSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     ResetState(ClearGesturesOnLevelLoad);
 }
        static int _m_LoadScene_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1))
                {
                    int _sceneBuildIndex = LuaAPI.xlua_tointeger(L, 1);

                    UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneBuildIndex);



                    return(0);
                }
                if (gen_param_count == 1 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 1);

                    UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneName);



                    return(0);
                }
                if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <UnityEngine.SceneManagement.LoadSceneMode>(L, 2))
                {
                    int _sceneBuildIndex = LuaAPI.xlua_tointeger(L, 1);
                    UnityEngine.SceneManagement.LoadSceneMode _mode; translator.Get(L, 2, out _mode);

                    UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneBuildIndex,
                        _mode);



                    return(0);
                }
                if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <UnityEngine.SceneManagement.LoadSceneParameters>(L, 2))
                {
                    int _sceneBuildIndex = LuaAPI.xlua_tointeger(L, 1);
                    UnityEngine.SceneManagement.LoadSceneParameters _parameters; translator.Get(L, 2, out _parameters);

                    UnityEngine.SceneManagement.Scene gen_ret = UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneBuildIndex,
                        _parameters);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.SceneManagement.LoadSceneMode>(L, 2))
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 1);
                    UnityEngine.SceneManagement.LoadSceneMode _mode; translator.Get(L, 2, out _mode);

                    UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneName,
                        _mode);



                    return(0);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING) && translator.Assignable <UnityEngine.SceneManagement.LoadSceneParameters>(L, 2))
                {
                    string _sceneName = LuaAPI.lua_tostring(L, 1);
                    UnityEngine.SceneManagement.LoadSceneParameters _parameters; translator.Get(L, 2, out _parameters);

                    UnityEngine.SceneManagement.Scene gen_ret = UnityEngine.SceneManagement.SceneManager.LoadScene(
                        _sceneName,
                        _parameters);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.SceneManagement.SceneManager.LoadScene!"));
        }
Beispiel #27
0
 static void SetGameRootAsFirstScene()
 {
     UnityEngine.SceneManagement.Scene scene = EditorSceneManager.GetActiveScene();
     SetBuildSettingFirstScene(scene);
     SetPlayModeStartScene(scene.path);
 }
Beispiel #28
0
 private void OnSceneSaved(UnityEngine.SceneManagement.Scene scene)
 {
     MarkNeedsCompute();
 }
Beispiel #29
0
 private static void ChangedActiveScene(UnityEngine.SceneManagement.Scene current, UnityEngine.SceneManagement.Scene next)
 {
     widgetCache.Clear();
 }
Beispiel #30
0
 public void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     FinishedLoadingScene(scene.name, scene.buildIndex);
 }
 public void SetUp()
 {
     scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
       child = new GameObject("childObject");
 }