private static void AddAssetToAddressable() { var setting = AssetDatabase.LoadAssetAtPath <AssetConfig>("Assets/Rain/Config/Editor/AssetConfig.asset"); var totalCount = setting.assets.Count; var nowIndex = 0; foreach (var config in setting.assets) { if (string.IsNullOrEmpty(config.groupName)) { var path = config.folderPath.Split('/'); config.groupName = path[path.Length - 1]; } EditorUtility.DisplayProgressBar("Addressable", $"处理 {config.groupName} 组相关内容", 1.0f * nowIndex / totalCount); AssetTools.CreateOrMoveAsset(config); ++nowIndex; } EditorUtility.DisplayProgressBar("Addressable", $"正在完成", 1); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); EditorUtility.ClearProgressBar(); EditorUtility.DisplayDialog("Addressable", "处理完成", "Done!"); }
private static void ClearMyAssetsGroup() { AssetTools.ClearGroup(); }
private static void ClearMyAssets() { AssetTools.ClearAllAssets(); }
private static void InitSetting() { AssetTools.LoadAddressableSettings(); }