「Unity/Editor/Addressableビルド」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→UnityEditorでAddressableビルド) |
(→UnityEditorでAddressableビルド) |
||
行16: | 行16: | ||
{ | { | ||
AddressableAssetSettings.CleanPlayerContent(); | AddressableAssetSettings.CleanPlayerContent(); | ||
+ | } | ||
+ | [MenuItem("Tools/AddressableCleanBuild")] | ||
+ | private static void CleanBuild() | ||
+ | { | ||
+ | string profileID = "Default"; | ||
+ | var settings = AddressableAssetSettingsDefaultObject.Settings; | ||
+ | settings.activeProfileId = settings.profileSettings.GetProfileId(profileID); | ||
+ | AddressableAssetSettings.CleanPlayerContent(); | ||
+ | AddressableAssetSettings.BuildPlayerContent(); | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
参考:https://baba-s.hatenablog.com/entry/2020/03/16/080000 | 参考:https://baba-s.hatenablog.com/entry/2020/03/16/080000 |
2021年8月4日 (水) 15:07時点における版
UnityEditorでAddressableビルド
Assets/Editor/AddressableBuild.cs
using UnityEditor; using UnityEngine; using UnityEditor.AddressableAssets.Settings; public static class AddressableBuild { [MenuItem("Tools/AddressableBuild")] private static void Build() { AddressableAssetSettings.BuildPlayerContent(); } [MenuItem("Tools/AddressableClean")] private static void Clean() { AddressableAssetSettings.CleanPlayerContent(); } [MenuItem("Tools/AddressableCleanBuild")] private static void CleanBuild() { string profileID = "Default"; var settings = AddressableAssetSettingsDefaultObject.Settings; settings.activeProfileId = settings.profileSettings.GetProfileId(profileID); AddressableAssetSettings.CleanPlayerContent(); AddressableAssetSettings.BuildPlayerContent(); } }