void OnDestroy()
        {
#if UNITY_EDITOR
            OnClear(this);
#endif
            if (refList != null)
            {
                refList.ClearRef();
            }
        }
예제 #2
0
        public IEnumerator LoadScene(string scenePath, bool clearUnused = false)
        {
            //Debug.Log("Load Scene Begin========");
            weakRefs.ClearRef();
            yield return(SceneManager.LoadSceneAsync("empty"));

            UnloadUnused(clearUnused);
            yield return(null);

            var loadHandle = GetLoadHandle(scenePath);

            yield return(loadHandle.LoadScene(LoadSceneMode.Single));
            //Debug.Log("Load Scene end==========");
        }