static int LoadSceneAsync(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes <int>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes <string>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <int, UnityEngine.SceneManagement.LoadSceneMode>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)ToLua.ToObject(L, 2);
                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <int, UnityEngine.SceneManagement.LoadSceneParameters>(L, 1))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.SceneManagement.LoadSceneParameters arg1 = StackTraits <UnityEngine.SceneManagement.LoadSceneParameters> .To(L, 2);

                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string, UnityEngine.SceneManagement.LoadSceneMode>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.SceneManagement.LoadSceneMode arg1 = (UnityEngine.SceneManagement.LoadSceneMode)ToLua.ToObject(L, 2);
                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <string, UnityEngine.SceneManagement.LoadSceneParameters>(L, 1))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.SceneManagement.LoadSceneParameters arg1 = StackTraits <UnityEngine.SceneManagement.LoadSceneParameters> .To(L, 2);

                UnityEngine.AsyncOperation o = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.SceneManagement.SceneManager.LoadSceneAsync"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#2
0
 public void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     UITools.RequireEventSystem();
 }
示例#3
0
        public override IEnumerator LoadLevel(string assetBundleName, string sceneName, UnityEngine.SceneManagement.LoadSceneMode loadMode, System.Action complete, System.Action <float> progressCallback)
        {
            var assetPaths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(assetBundleName, sceneName);

            if (assetPaths.Length == 0)
            {
                Debug.LogError(string.Format("simulate assetBundle:\"{0}\" asset:\"{1}\" failed", assetBundleName, sceneName));
                yield break;
            }

            var assetPath      = assetPaths[0];
            var asyncOperation = EditorApplication.LoadLevelAsyncInPlayMode(assetPath);

            while (asyncOperation.isDone)
            {
                if (progressCallback != null)
                {
                    progressCallback(asyncOperation.progress);
                }

                yield return(null);
            }

            if (complete != null)
            {
                complete();
            }
        }
示例#4
0
 protected virtual void OnSceneLoaded(UnityEngine.SceneManagement.Scene p_scene, UnityEngine.SceneManagement.LoadSceneMode p_mode)
 {
     if (s_instance != this && s_instance != null)
     {
         Object.Destroy(this.gameObject);
     }
     else
     {
         if (s_instance == null)
         {
             Instance = this;
         }
     }
 }
示例#5
0
 public void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     FinishedLoadingScene(scene.name, scene.buildIndex);
 }
示例#6
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     LightningBolt.ClearCache();
 }
 private void SceneManagerOnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode)
 {
     SceneLoadedHandler(scene.buildIndex);
 }
示例#8
0
 static void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     UnityEngine.Debug.Log("Loaded");
 }
示例#9
0
 private void SceneManagerSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     ResetState(ClearGesturesOnLevelLoad);
 }
示例#10
0
 public void SceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     this.RaiseEngineSceneLoadedEvent(scene, mode);
 }
 private static void TrackOnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     //if scene is from assetbundle, path will be assetpath inside bundle
     if (s_SceneNames.TryGetValue(scene.path, out var loadedBundle))
     {
         RetainBundleInternal(loadedBundle, 1);
         scene.GetRootGameObjects(s_SceneRootObjectCache);
         for (int i = 0; i < s_SceneRootObjectCache.Count; i++)
         {
             TrackIndepenantInternal(loadedBundle, s_SceneRootObjectCache[i]);
         }
         s_SceneRootObjectCache.Clear();
     }
 }
示例#12
0
 public EngineSceneEventArgs(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode = UnityEngine.SceneManagement.LoadSceneMode.Single)
     : base()
 {
     this.Scene = scene;
     this.Mode = mode;
 }
示例#13
0
 internal void RaiseEngineSceneLoadedEvent(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     lock (this._eventTable)
     {
         var callback = (System.EventHandler<EngineSceneEventArgs>)this._eventTable["EngineSceneLoaded"];
         callback?.Invoke(this, new EngineSceneEventArgs(scene, mode));
     }
 }
示例#14
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     UnityEngine.SceneManagement.SceneManager.sceneLoaded -= _instance.OnSceneLoaded;
     MixCastRegistry.ShowRegistryMismatchWarningIfNeeded();
 }
示例#15
0
 private void SceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     LevelStart();
 }
示例#16
0
 void TestFix(UnityEngine.SceneManagement.Scene s, UnityEngine.SceneManagement.LoadSceneMode m)
 {
     stageClearText.SetActive(false);
 }
示例#17
0
文件: Tween.cs 项目: Nufflee/LD41
 private void SceneManagerSceneLoaded(UnityEngine.SceneManagement.Scene s, UnityEngine.SceneManagement.LoadSceneMode m)
 {
     tweens.Clear();
 }
示例#18
0
 protected virtual void OnSceneLoaded(UnityEngine.SceneManagement.Scene p_scene, UnityEngine.SceneManagement.LoadSceneMode p_mode)
 {
     if (!_loaded)
     {
         _loaded = true;
         CorrectValues(true);
         UpdateRigidBody2D();
         UpdateResistence();
     }
 }
示例#19
0
        void AddMixerToAudioSourcesOnSceneLoad(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
        {
            if (!autoAddMixerOnSceneLoad)
            {
                return;
            }

            foreach (var rootGO in scene.GetRootGameObjects())
            {
                var emptyMixerSources = rootGO.GetComponentsInChildren <AudioSource>(true).Where(x => x != null && x.outputAudioMixerGroup == null).ToList();
                foreach (AudioSource source in emptyMixerSources)
                {
                    source.outputAudioMixerGroup = audioMixer.outputAudioMixerGroup;
                }
            }
        }
示例#20
0
        void SceneLoader_OnSceneLoaded(On.SceneLoader.orig_OnSceneLoaded orig, UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadSceneMode)
        {
            orig(scene, loadSceneMode);

            if (scene.name.Equals(ELevel.Level_06_A_BambooCreek.ToString() + "_Build"))
            {
                try {
                    spawner = UnityEngine.Object.Instantiate(Resources.FindObjectsOfTypeAll <TurtleManRangedSpawner>()[0]);
                    Vector3 newPos = new Vector3(475f, -90.5f);
                    spawner.transform.position = newPos;
                    Manager <Level> .Instance.LevelRooms["460492-92-76"].roomObjects.Add(spawner.gameObject);

                    SpawnZone zone = UnityEngine.Object.Instantiate(Resources.FindObjectsOfTypeAll <SkeloutSpawner>()[0].transform.parent.parent.gameObject).GetComponent <SpawnZone>();
                    zone.transform.position = newPos;
                    Manager <Level> .Instance.LevelRooms["460492-92-76"].roomObjects.Add(zone.spawners[0].gameObject);
                    zone.spawnZoneRect     = new Rect(new Vector2(460, -92), new Vector2(32, 16));
                    zone.spawnLaneCount    = 3;
                    zone.spawnInterval     = .5f;
                    zone.maxSpawnedObjects = 30;

                    CourierLogger.Log("HarderBosses", "All bamboo creek spawners placed");
                } catch (Exception e) {
                    Console.WriteLine("Exception while placing bamboo creek spawners");
                    CourierLogger.LogDetailed(e, "HarderBosses");
                }
            }
        }
示例#21
0
        private void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
        {
            /*if (!hasClosedStartingCursor && (arg0.name == "loadingbasic" || arg0.name == "title"))
             * {
             *  //ToggleCursorAlt();
             * }*/

            if (!hasClosedStartingCursor)
            {
                ToggleCursor(arg0.name);
            }
        }
示例#22
0
 void OnLevelFinishedLoading(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     mBackText = FindObjectOfType <BackText>();
 }
        private void SceneManager_SceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
        {
            var  loadingScene     = CognitiveVR_Preferences.FindScene(scene.name);
            bool replacingSceneId = false;

            if (CognitiveVR_Preferences.Instance.SendDataOnLevelLoad)
            {
                Core.SendDataEvent();
            }


            if (mode == UnityEngine.SceneManagement.LoadSceneMode.Additive)
            {
                //if scene loaded has new scene id
                if (loadingScene != null && !string.IsNullOrEmpty(loadingScene.SceneId))
                {
                    replacingSceneId = true;
                }
            }
            if (mode == UnityEngine.SceneManagement.LoadSceneMode.Single || replacingSceneId)
            {
                DynamicObject.ClearObjectIds();
                //CognitiveVR_Manager.TickEvent -= CognitiveVR_Manager_OnTick;
                Core.SetTrackingScene("");
                if (loadingScene != null)
                {
                    if (!string.IsNullOrEmpty(loadingScene.SceneId))
                    {
                        //CognitiveVR_Manager.TickEvent += CognitiveVR_Manager_OnTick;
                        Core.SetTrackingScene(scene.name);
                    }
                }
            }
            OnLevelLoaded();
        }
        //-----------------------------------------------------------

        // シーンをロードまたは加算する(同期版)
        private bool LoadOrAdd_Private(string tName, Type tType, UnityEngine.Object[] rTarget, string tTargetName, string tLabel, System.Object tValue, UnityEngine.SceneManagement.LoadSceneMode tMode, bool tHistory)
        {
            if (string.IsNullOrEmpty(tName) == true)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(tLabel) == false)
            {
                SetParameter_Private(tLabel, tValue);
            }

            if (tMode == UnityEngine.SceneManagement.LoadSceneMode.Single)
            {
                // ロードの場合は履歴に追加する
                previousName = GetActiveName();

                if (tHistory == true)
                {
                    history.Add(tName);
                }
            }

            UnityEngine.SceneManagement.SceneManager.LoadScene(tName, tMode);

            //------------------------------------------------------------------------------------------

            UnityEngine.SceneManagement.Scene tScene = UnityEngine.SceneManagement.SceneManager.GetSceneByName(tName);
            if (tScene.IsValid() == false || tScene.isLoaded == false)
            {
                return(false);
            }

            if (tType != null && rTarget != null && rTarget.Length > 0)
            {
                GetInstance_Private(tScene, tType, rTarget, tTargetName, null);
            }

            return(true);
        }
示例#25
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode mode)
 {
     //RepositionCamera(CurrentPosition);
 }
        // シーンをロードまたは加算する(非同期版)
        private IEnumerator LoadOrAddAsync_Private(string tName, Type tType, UnityEngine.Object[] rTarget, string tTargetName, string tLabel, System.Object tValue, UnityEngine.SceneManagement.LoadSceneMode tMode, bool tHistory, Request tRequest)
        {
            if (string.IsNullOrEmpty(tName) == true)
            {
                yield break;
            }

            //----------------------------------------------------------

            if (tType != null)
            {
                // 指定の型のコンポーネントが存在する場合はそれが完全に消滅するまで待つ
                while (true)
                {
                    if (GameObject.FindObjectOfType(tType) == null)
                    {
                        break;
                    }
                    yield return(null);
                }
            }

            //----------------------------------------------------------

            if (string.IsNullOrEmpty(tLabel) == false)
            {
                SetParameter_Private(tLabel, tValue);
            }

            if (tMode == UnityEngine.SceneManagement.LoadSceneMode.Single)
            {
                // ロードの場合は履歴に追加する
                previousName = GetActiveName();

                if (tHistory == true)
                {
                    history.Add(tName);
                }
            }

            yield return(UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(tName, tMode));

            //------------------------------------------------------------------------------------------

            UnityEngine.SceneManagement.Scene tScene = UnityEngine.SceneManagement.SceneManager.GetSceneByName(tName);

            if (tScene.IsValid() == false)
            {
                if (tRequest != null)
                {
                    tRequest.error = "Could not load";
                }
                yield break;
            }

            // シーンの展開が完了するのを待つ
            while (tScene.isLoaded == false)
            {
                yield return(null);
            }

            if (tType != null && rTarget != null && rTarget.Length > 0)
            {
                GetInstance_Private(tScene, tType, rTarget, tTargetName, tRequest);
            }

            if (tRequest != null)
            {
                tRequest.isDone = true;
            }
        }
 private void SceneManager_sceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     hitPoint = Vector3.zero;
     Teleport();
 }
示例#28
0
 private void SceneLoaded(UnityEngine.SceneManagement.Scene _scene, UnityEngine.SceneManagement.LoadSceneMode _loadSceneMode)
 {
     AssignOverrides();
 }
示例#29
0
 void OnSceneLoaded(UnityEngine.SceneManagement.Scene scene, UnityEngine.SceneManagement.LoadSceneMode loadingMode)
 {
     this.CalledOnLevelWasLoaded(scene.buildIndex);
 }
示例#30
0
 private void OnSceneLoaded(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1)
 {
     OnEnable();
 }