Esempio n. 1
0
        public static void Load()
        {
            //获取当前打开场景(path)
            string currSceneName = EditorApplication.currentScene;

            //获取当前打开场景名称
            currSceneName = currSceneName.Substring(currSceneName.LastIndexOf("/") + 1);
            currSceneName = currSceneName.Replace(".unity", "");
            SceneRootData sceneRootData = (SceneRootData)AssetDatabase.LoadAssetAtPath(string.Format("Assets/Resources/SceneRectData/SceneRectData_{0}.asset", currSceneName),
                                                                                       typeof(SceneRootData));

            GraphRoot.load(new GameObject("GraphLoadRoot"), sceneRootData);
        }
Esempio n. 2
0
        //加载 Scene
        IEnumerator LoadGameSceneAsync(string assetBundleName)
        {
            WWW download = new WWW(AppContentPath() + assetBundleName);

            yield return(download);

            assetBundle = download.assetBundle;
            string[] assetPaths = assetBundle.GetAllAssetNames();

            SceneRootData sceneRootData = assetBundle.LoadAsset <SceneRootData>(assetPaths[0]);

            string goName = assetBundlesPath;

            if (assetBundlesPath.LastIndexOf("/") > -1)
            {
                goName = assetBundlesPath.Substring(assetBundlesPath.LastIndexOf("/") + 1);
            }

            GraphRoot.load(new GameObject("GraphRoot_" + goName), sceneRootData);

            //perfabAssetBundle = AssetBundle.LoadFromFile(Application.streamingAssetsPath +   "/" + "map001.prefab");
        }