コード例 #1
0
        private void AsyncLoadScene(SceneLoadItem load_item)
        {
#if UNITY_EDITOR
            string[] paths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(
                load_item.asset_id.bundleName,
                load_item.asset_id.assetName);

            if (paths.Length <= 0)
            {
                return;
            }

            AsyncOperation asyncOperation;
            if (LoadSceneMode.Additive == load_item.load_mode)
            {
                asyncOperation = EditorApplication.LoadLevelAdditiveAsyncInPlayMode(paths[0]);
            }
            else
            {
                asyncOperation = EditorApplication.LoadLevelAsyncInPlayMode(paths[0]);
            }

            WaitLoadSceneItem wait_item = new WaitLoadSceneItem();
            wait_item.load_item      = load_item;
            wait_item.asyncOperation = asyncOperation;
            this.wait_list.Add(wait_item);
#endif
        }
コード例 #2
0
ファイル: SceneLoader.cs プロジェクト: Klanly/u3dgame
        private void AsyncLoadScene(SceneLoadItem load_item)
        {
            AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(load_item.asset_id.assetName, load_item.load_mode);

            WaitLoadSceneItem wait_item = new WaitLoadSceneItem();

            wait_item.load_item      = load_item;
            wait_item.asyncOperation = asyncOperation;
            this.wait_list.Add(wait_item);
        }
コード例 #3
0
        public void CreateScene(AssetId asset_id, LoadSceneMode mode, CreateAssetCallback create_callback)
        {
            SceneLoadItem load_item = new SceneLoadItem();

            load_item.asset_id      = asset_id;
            load_item.type          = AssetType.SCENE;
            load_item.load_mode     = mode;
            load_item.load_callback = (AssetItem item) =>
            {
                create_callback(asset_id);
            };

            LoaderManager.Instance.LoadAsset(load_item);
        }