private void GetCurrentConfig() { // Load default config _curConfig = LoadConfig(_configPath); // Create default config if (_curConfig == null) { CreateConfig(_configPath); LoadConfig(_configPath); } }
private void CreateConfig(string desPath) { // Prepare directory EditorHelper.PreparePathDirectory(desPath); // Replace with new if (File.Exists(desPath)) { AssetDatabase.DeleteAsset(desPath); } // Create new instance ResItemCodeMakerConfig asset = CreateInstance <ResItemCodeMakerConfig>(); // Create asset AssetDatabase.CreateAsset(asset, desPath); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
private ResItemCodeMakerConfig LoadConfig(string path) { _curConfig = AssetDatabase.LoadAssetAtPath(path, typeof(ResItemCodeMakerConfig)) as ResItemCodeMakerConfig; return(_curConfig); }