概要
使用例
using System.Linq;
using UnityEditor;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.AddressableAssets.Settings.GroupSchemas;
public static class Example
{
[MenuItem( "Tools/Hoge" )]
public static void Hoge()
{
var list = AssetDatabase
.FindAssets( "t:BundledAssetGroupSchema" )
.Select( c => AssetDatabase.GUIDToAssetPath( c ) )
.Select( c => AssetDatabase.LoadAssetAtPath<BundledAssetGroupSchema>( c ) )
;
var settings = AddressableUtils.GetSettings();
foreach ( var n in list )
{
UpdatePath( settings, n );
}
}
private static void UpdatePath
(
AddressableAssetSettings settings,
BundledAssetGroupSchema schema
)
{
schema.BuildPath.SetVariableByName( settings, "BuildTarget" );
schema.LoadPath.SetVariableByName( settings, "BuildTarget" );
}
}