Exemplo n.º 1
0
        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!");
        }
Exemplo n.º 2
0
 private static void ClearMyAssetsGroup()
 {
     AssetTools.ClearGroup();
 }
Exemplo n.º 3
0
 private static void ClearMyAssets()
 {
     AssetTools.ClearAllAssets();
 }
Exemplo n.º 4
0
 private static void InitSetting()
 {
     AssetTools.LoadAddressableSettings();
 }