Ejemplo n.º 1
0
        public bool DelRes(string path)
        {
            var name = AssetUtility.GetAssetNameFromPath(path);

            if (content.ContainsKey(name))
            {
                content.Remove(name);
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public bool AddRes(string path)
        {
            var key = AssetUtility.GetAssetNameFromPath(path);

            if (content.ContainsKey(key))
            {
                throw new ArgumentException("Duplicate Named Resources:" + key);
            }
            var type       = AssetTypeToGen();
            var resPath    = AssetUtility.RelativeResourcesPath(path);
            var assetPath  = AssetUtility.RelativeAssetsPath(path);
            var bundleName = AssetUtility.GetAssetBundleNameAtPath(assetPath);
            var value      = AssetInfo.Create(type, resPath, bundleName, assetPath);

            content.Add(key, value);
            return(true);
        }
Ejemplo n.º 3
0
        public bool DelRes(string path)
        {
            var list = File.ReadAllLines(path).Where(line => !(line.Trim().Length == 0 || string.IsNullOrEmpty(line))).Select(line => line.Split(new[] { '=' }, 2, 0)).ToList();

            for (var i = 0; i < list.Count; ++i)
            {
                if (list[i].Length != 2)
                {
                    continue;
                }
                var key = AssetUtility.GetAssetNameFromPath(list[i][0]);
                if (content.ContainsKey(key))
                {
                    content.Remove(key);
                }
            }
            return(true);
        }
Ejemplo n.º 4
0
        public bool AddRes(string path)
        {
            var key = AssetUtility.GetAssetNameFromPath(path);

            if (content.ContainsKey(key))
            {
                throw new ArgumentException("Duplicate Named Resources:" + key);
            }
            else
            {
                Shader s = AssetUtility.LoadAssetAtFullPath <Shader>(path);
                if (s)
                {
                    content.Add(key, s.name);
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        public override bool AddRes(string path)
        {
            var list = GetIniData(path);

            for (var i = 0; i < list.Count; ++i)
            {
                if (list[i].Length == 2)
                {
                    var key = AssetUtility.GetAssetNameFromPath(list[i][0]);
                    //string value = list[i][1].Trim();
                    if (content.ContainsKey(key))
                    {
                        throw new ArgumentException("Duplicate Named Resources:" + key);
                    }
                    content.Add(key, key);
                }
            }
            return(true);
        }