示例#1
0
 public void ToSimpleDemo()
 {
     StartCoroutine(SubBuild_AssetBundleManager.GetAssetBundleInfos(() => {
         StartCoroutine(SceneLoader.RequestScene("DemoSimple", (onLoaded) => {
             //On loading is finish,the following scripts will run.
             Debug.Log("Scene is Loaded!");
             canvasObj.SetActive(false);
         }));
     }));
 }
示例#2
0
        void Start()
        {
            DontDestroyOnLoad(this.gameObject); //Coroutine need this gameobject to keep active!

            //Set the object which coroutine runs on.
            SubBuild_AssetBundleManager.Init(this);


            StartCoroutine(SubBuild_AssetBundleManager.AssetBundleLoop());

            //Get Dependence AssetBundle Info
        }
示例#3
0
        public void ToComplexAdventure()
        {
            StartCoroutine(SubBuild_AssetBundleManager.GetAssetBundleInfos(() => {
                UScene.SceneManager.LoadScene("Adventure_Cooked");
                SubBuild_AssetBundleManager.LoadAssetFromAssetBundle(new AssetRequestTask()
                {
                    currentAssetName = "player.actor",
                    onAssetLoaded    = (myCharacter) => {
                        GameObject player = Instantiate <GameObject>((GameObject)myCharacter);
                        player.SetActive(false);

                        GameObject.Find("Sets/Ground_CookedResource").GetComponent <SceneAssetPrefab>().onFinish = () => {
                            player.SetActive(true);
                        };

                        GameObject.Find("Sets/Ground_CookedResource").GetComponent <SceneAssetPrefab>().LoadAsset();

                        canvasObj.SetActive(false);
                    }
                });
            }));
        }