コード例 #1
0
 /// <summary>
 /// 添加非资源信息.
 /// </summary>
 /// <param name="iUnResourePath">非资源路径.</param>
 public BundleUnResource AddUnResource(BundleUnResource iUnResourceInfo)
 {
     if (iUnResourceInfo == null)
     {
         return(null);
     }
     return(AddUnResource(iUnResourceInfo.Path));
 }
コード例 #2
0
        /// <summary>
        /// 移除非资源信息.
        /// </summary>
        /// <returns><c>true</c>, 移除成功, <c>false</c> 移除失败.</returns>
        /// <param name="iUnResourcePath">非资源信息.</param>
        public bool RemoveUnResource(string iUnResourcePath)
        {
            BundleUnResource bur = null;

            // 不存在存在
            if (this.isUnResoureExist(iUnResourcePath, out bur) == true)
            {
                if (bur != null)
                {
                    this.UnResources.Remove(bur);
                    UtilsAsset.SetAssetDirty(this);
                }
                return(true);
            }
            return(false);
        }
コード例 #3
0
        /// <summary>
        /// 判断非资源信息是否存在.
        /// </summary>
        /// <returns><c>true</c>, 村贼, <c>false</c> 不存在.</returns>
        /// <param name="iUnResourcePath">非资源路径.</param>
        /// <param name="iBur">非资源信息.</param>
        private bool isUnResoureExist(string iUnResourcePath, out BundleUnResource iBur)
        {
            bool bolRet = false;

            iBur = null;
            foreach (BundleUnResource bur in this.UnResources)
            {
                if (bur.Path == iUnResourcePath)
                {
                    iBur   = bur;
                    bolRet = true;
                    break;
                }
            }

            return(bolRet);
        }
コード例 #4
0
        /// <summary>
        /// 添加非资源信息.
        /// </summary>
        /// <param name="iUnResourePath">非资源路径.</param>
        public BundleUnResource AddUnResource(string iUnResourcePath)
        {
            BundleUnResource bur = null;

            // 不存在存在
            if (this.isUnResoureExist(iUnResourcePath, out bur) == false)
            {
                bur = new BundleUnResource();
                this.UnResources.Add(bur);
            }
            if (bur != null)
            {
                bur.Path = iUnResourcePath;
                UtilsAsset.SetAssetDirty(this);
            }
            else
            {
                UtilsLog.Error("AddUnResource", "Failed!!!(Path:{0})",
                               iUnResourcePath);
            }
            return(bur);
        }