コード例 #1
0
        public static void CreateAssetLibrary()
        {
            HashSet <string> keys = new HashSet <string>();

            foreach (Object resource in Resources.LoadAll(""))
            {
                string name = resource.name;
                if (name.Contains('.'))
                {
                    continue;
                }
                if (resource is Shader shader)
                {
                    int dirIndex = name.LastIndexOf('/') + 1;
                    if (dirIndex > -1)
                    {
                        name = name.Substring(dirIndex, name.Length - dirIndex);
                    }
                }
                keys.Add(name);
            }
            ConstantCreator constantCreator = new ConstantCreator(TypeName() + "Keys", nameSpace, keys.ToArray());

            constantCreator.Save(keyPath, "AssetManagerKeys.cs");
        }
コード例 #2
0
        public virtual void Save()
        {
            this.Sort();
            this.cacheIsSafe = false;
            Helpers.SerializeAndSaveToFile(this, dataPath + TypeName() + "/", TypeName(), ".meglo");

            ConstantCreator constantCreator = new ConstantCreator(TypeName() + "Keys", nameSpace, this.Keys.ToArray());

            constantCreator.Save(keyPath, TypeName() + "Keys.cs");
        }
コード例 #3
0
        public override void Save()
        {
            this.Sort();
            this.cacheIsSafe = false;
            Helpers.SerializeAndSaveToFile(this.addressCache, dataPath + "AssetManager/", "AssetManager", ".meglo");

            ConstantCreator constantCreator = new ConstantCreator(TypeName() + "Keys", nameSpace, this.Keys.ToArray());

            constantCreator.Save(keyPath, "AssetManagerKeys.cs");
        }