예제 #1
0
 public void Clear()
 {
     if (this.m_resourceManager == null)
     {
         AssetLogger.Error("null == m_resourceManager");
         return;
     }
     this.m_resourceManager.Clear();
 }
        /// <summary>
        /// 根据名字取得有引用的资源
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        private CollectDepResourceData GetCollectDepResourceData(string name)
        {
            CollectDepResourceData result = null;

            if (!this.mDicCollectDepResourceData.TryGetValue(name, out result))
            {
                AssetLogger.Error(string.Format("mDicCollectDepResourceData.TryGetValue(name, out collectDepResourceData) == false:{0}", name));
            }
            return(result);
        }
예제 #3
0
 /// <summary>
 /// 通过Resources加载资源
 /// </summary>
 /// <param name="strAssetFile"></param>
 /// <returns></returns>
 public UnityEngine.Object Load(string strAssetFile)
 {
     UnityEngine.Object @object = null;
     if (!string.IsNullOrEmpty(strAssetFile))
     {
         @object = Resources.Load(strAssetFile);
     }
     if (null == @object)
     {
         AssetLogger.Error("null == obj: " + strAssetFile);
     }
     Resources.UnloadUnusedAssets();
     return(@object);
 }
예제 #4
0
 public void Update()
 {
     try
     {
         if (this.m_resourceManager != null)
         {
             this.m_resourceManager.OnUpdate();
         }
     }
     catch (Exception ex)
     {
         AssetLogger.Fatal(ex.ToString());
     }
 }
예제 #5
0
 /// <summary>
 /// 初始化资源管理器
 /// </summary>
 /// <param name="editorResourceManager"></param>
 public void Init(IResourceManager editorResourceManager)
 {
     if ((RuntimePlatform.WindowsEditor == Application.platform || Application.platform == RuntimePlatform.OSXEditor || Application.platform == RuntimePlatform.WindowsPlayer) && editorResourceManager != null)
     {
         this.m_resourceManager = editorResourceManager;
         //this.m_resourceManager = ResourceFactory.GetResourceManager();
     }
     if (this.m_resourceManager == null)
     {
         this.m_resourceManager = ResourceFactory.GetResourceManager();
     }
     if (this.m_resourceManager != null)
     {
         this.m_resourceManager.Init(ResourceManager.GetFullPath("", false), ResourceManager.GetFullPath("", true));
         return;
     }
     AssetLogger.Error("null == m_resourceManager");
 }
예제 #6
0
        public IAssetRequest LoadEffect(string relativeUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType)
        {
            if (this.m_resourceManager == null)
            {
                AssetLogger.Error("null == m_resourceManager");
                return(null);
            }
            IAssetRequest result = null;

            try
            {
                result = this.m_resourceManager.LoadEffect(relativeUrl, callBackFun, assetPRIType);
            }
            catch (Exception ex)
            {
                AssetLogger.Fatal(ex.ToString());
            }
            return(result);
        }
예제 #7
0
        public IAssetRequest CreateAssetRequest(string strCompleteUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType, EnumAssetType eAssetType)
        {
            if (this.m_resourceManager == null)
            {
                AssetLogger.Error("null == m_resourceManager");
                return(null);
            }
            IAssetRequest result = null;

            try
            {
                result = this.m_resourceManager.CreateAssetRequest(strCompleteUrl, callBackFun, assetPRIType, eAssetType);
            }
            catch (Exception ex)
            {
                AssetLogger.Fatal(ex.ToString());
            }
            return(result);
        }
예제 #8
0
        public IAssetRequest LoadScene(string relativeUrl, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType)
        {
            IAssetRequest result;

            if (null == this.m_resourceManager)
            {
                AssetLogger.Error("null == m_resourceManager");
                result = null;
            }
            else
            {
                IAssetRequest assetRequest = null;
                try
                {
                    assetRequest = this.m_resourceManager.LoadScene(relativeUrl, callBackFun, assetPRIType);
                }
                catch (Exception ex)
                {
                    AssetLogger.Fatal(ex.ToString());
                }
                result = assetRequest;
            }
            return(result);
        }
예제 #9
0
 public static void SetLog(IXLog log)
 {
     AssetLogger.Init(log);
 }