コード例 #1
0
 protected override void OnUnload(bool all)
 {
     if (Bundle != null)
     {
         DLCManager.UnloadBundle(Bundle, all);
     }
 }
コード例 #2
0
 internal Asset(string bundleName, string assetName, System.Type type)
 {
     this.AssetName      = assetName;
     this.BundleName     = bundleName;
     this.AssetFullPath  = DLCManager.GetAssetPath(bundleName, assetName);
     this.Mapkey         = bundleName + assetName;
     this.RealBundleName = DLCManager.GetBundleName(AssetFullPath);
     this.DlcName        = DLCManager.GetDLCName(bundleName, assetName);
     AssetType           = type;
 }
コード例 #3
0
        protected override void OnLoad()
        {
#if UNITY_EDITOR
            if (DLCConfig.Ins.IsEditorMode)
            {
                Object = UnityEditor.AssetDatabase.LoadAssetAtPath(AssetFullPath, AssetType);
                return;
            }
#endif
            {
                Bundle    = DLCManager.LoadBundle(RealBundleName, DlcName, true);
                loadState = LoadStateType.Loading;
                loadCount = 0;
            }
        }
コード例 #4
0
ファイル: DLCItem.cs プロジェクト: chengyimingvb/CYMUni
        public DLCManifest GetManifestFile()
        {
            DLCManifest reader = null;

            if (DLCConfig.Ins.IsEditorOrConfigMode)
            {
                reader = FileUtil.LoadJson <DLCManifest>(GetManifest());
            }
            else
            {
                var asset = DLCManager.LoadRawAsset <TextAsset>(Const.BN_Config, "DLCManifest", this);
                if (asset != null)
                {
                    reader = JsonUtility.FromJson <DLCManifest>(asset.text);
                }
            }
            return(reader);
        }
コード例 #5
0
ファイル: DLCItem.cs プロジェクト: chengyimingvb/CYMUni
 public byte[] GetExcelFile(string name)
 {
     if (DLCConfig.Ins.IsEditorOrConfigMode)
     {
         string file = GetExcel(name);
         if (File.Exists(file))
         {
             return(File.ReadAllBytes(file));
         }
     }
     else
     {
         var asset = DLCManager.LoadRawAsset <TextAsset>(Const.BN_Excel, name, this);
         if (asset != null)
         {
             return(asset.bytes);
         }
     }
     return(null);
 }
コード例 #6
0
        protected override void OnLoad()
        {
#if UNITY_EDITOR
            if (DLCConfig.Ins.IsEditorMode)
            {
                Object = UnityEditor.AssetDatabase.LoadAssetAtPath(AssetFullPath, AssetType);
                return;
            }
#endif
            {
                Bundle = DLCManager.LoadBundle(RealBundleName, DlcName);
                if (Bundle == null)
                {
                    if (DLCManager.IsNextLogError)
                    {
                        CLog.Error("没有这个Bundle,错误的realBundleName:{0} dlcName:{1}", RealBundleName, DlcName);
                    }
                    return;
                }
                Object = Bundle.LoadAsset(AssetName, AssetType);
            }
        }
コード例 #7
0
        protected override void OnLoad()
        {
#if UNITY_EDITOR
            if (DLCConfig.Ins.IsEditorMode)
            {
                asyncOperation = EditorSceneManager.LoadSceneAsyncInPlayMode(AssetFullPath, new LoadSceneParameters(LoadSceneMode.Additive, LocalPhysicsMode.None));
                loadState      = LoadStateType.Loading;
                loadCount      = 0;
                return;
            }
#endif
            {
                Bundle = DLCManager.LoadBundle(RealBundleName, DlcName, true);
                if (Bundle == null)
                {
                    CLog.Error($"无法加载场景Bundle!!{RealBundleName}:{DlcName}");
                }
                else
                {
                }
                loadState = LoadStateType.Loading;
                loadCount = 0;
            }
        }