public static EditorModeAssetLoader GetLoader(int resourceIndex)
        {
            EditorModeAssetLoader loader = null;

            s_ResIndexToLoader.TryGetValue(resourceIndex, out loader);
            return(loader);
        }
        public static EditorModeAssetLoader GetLoader(string bundleName, string assetName)
        {
            EditorModeAssetLoader loader = null;
            string assetKey;

            CalculateAssetKey(bundleName, assetName, out assetKey);
            s_NameToLoader.TryGetValue(assetKey, out loader);
            return(loader);
        }
Esempio n. 3
0
        public int LoadAssetSync <T>(string bundleName, string assetName, Action <bool, T> loadedAction) where T : Object
        {
            var assetLoadMode = GameCenter.s_ConfigManager.GlobalGameConfig.AssetLoadMode;

#if UNITY_EDITOR
            if (assetLoadMode == GameConfig.AssetLoadModeEnum.EditMode)
            {
                return(EditorModeAssetLoader.LoadSync(bundleName, assetName, loadedAction));
            }
#endif
            return(BundleAssetLoader.LoadSync(bundleName, assetName, loadedAction));
        }
Esempio n. 4
0
        public void UnLoadAsset(int resourceIndex)
        {
            var assetLoadMode = GameCenter.s_ConfigManager.GlobalGameConfig.AssetLoadMode;

#if UNITY_EDITOR
            if (assetLoadMode == GameConfig.AssetLoadModeEnum.EditMode)
            {
                EditorModeAssetLoader.UnLoad(resourceIndex);
            }
            else
#endif
            BundleAssetLoader.UnLoad(resourceIndex);
        }