うにてぃブログ

主にUnityとC#に関する記事を書いていきます

【Unity】Addressables Group BuildPath・LoadPath をスクリプトから変更する

        var settings = AddressableAssetSettingsDefaultObject.Settings;
        var schema = settings.DefaultGroup.GetSchema<BundledAssetGroupSchema>();
        // Remote のパスを設定
        schema.BuildPath.SetVariableByName(settings, AddressableAssetSettings.kRemoteBuildPath);
        schema.LoadPath.SetVariableByName(settings, AddressableAssetSettings.kRemoteLoadPath);
        
        // Local のパスを設定
        schema.BuildPath.SetVariableByName(settings, AddressableAssetSettings.kLocalBuildPath);
        schema.LoadPath.SetVariableByName(settings, AddressableAssetSettings.kLocalLoadPath);