コード例 #1
0
    public LoadedAssetsStruct CreateLoadedAsset(AssetBundle AB, string S, bool bL, bool bW)
    {
        LoadedAssetsStruct LA = new LoadedAssetsStruct();

        LA.AssetBundle = AB;
        LA.Path        = S;
        LA.bLocal      = bL;
        LA.bWorld      = bW;
        return(LA);
    }
コード例 #2
0
    public bool AddLoadedAsset(LoadedAssetsStruct LA)
    {
        for (int i = 0; i < LoadedAssets.Count; i++)
        {
            if (LoadedAssets[i].Path == LA.Path)
            {
                return(false);
            }
        }

        LoadedAssets.Add(LA);
        AddHistoryAsset(CreateAssetInfo(LA.Path, LA.bLocal, bWorld));
        return(true);
    }
コード例 #3
0
    public void OpenScene(LoadedAssetsStruct LoadedAssets)
    {
        if (LoadedAssets.AssetBundle == null)
        {
            return;
        }

        if (LoadedAssets.bWorld)
        {
            string[] scenePaths = LoadedAssets.AssetBundle.GetAllScenePaths();
            string   sceneName  = System.IO.Path.GetFileNameWithoutExtension(scenePaths[0]);
            //	EditorSceneManager.OpenScene(sceneName);
            EditorSceneManager.LoadScene(sceneName);
            //	EditorApplication.OpenScene(sceneName);
        }
    }
コード例 #4
0
    public void AddToScene(LoadedAssetsStruct LoadedAssets)
    {
        if (LoadedAssets.AssetBundle == null)
        {
            return;
        }

        if (LoadedAssets.bWorld)
        {
            string[] scenePaths = LoadedAssets.AssetBundle.GetAllScenePaths();
            string   sceneName  = System.IO.Path.GetFileNameWithoutExtension(scenePaths[0]);
            SceneManager.LoadScene(sceneName);
        }
        else
        {
            GameObject ava = LoadAvatar(LoadedAssets.AssetBundle);
            Instantiate(ava);
        }
    }