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"); }
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"); }
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"); }