You've already forked UniversalViewer
Eversoul support WIP
Updated line renderer material for handles Handle fixes Fixes
This commit is contained in:
46
Assets/Scripts/Editor/BuildAddressables.cs
Normal file
46
Assets/Scripts/Editor/BuildAddressables.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
/// <summary>
|
||||
/// The script gives you choice to whether to build addressable bundles when clicking the build button.
|
||||
/// For custom build script, call PreExport method yourself.
|
||||
/// For cloud build, put BuildAddressablesProcessor.PreExport as PreExport command.
|
||||
/// Discussion: https://forum.unity.com/threads/how-to-trigger-build-player-content-when-build-unity-project.689602/
|
||||
///
|
||||
/// License: The MIT License https://opensource.org/licenses/MIT
|
||||
/// </summary>
|
||||
using UnityEditor;
|
||||
using UnityEditor.AddressableAssets;
|
||||
using UnityEditor.AddressableAssets.Settings;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
class BuildAddressablesProcessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Run a clean build before export.
|
||||
/// </summary>
|
||||
static public void PreExport()
|
||||
{
|
||||
Debug.Log("BuildAddressablesProcessor.PreExport start");
|
||||
AddressableAssetSettings.CleanPlayerContent(
|
||||
AddressableAssetSettingsDefaultObject.Settings.ActivePlayerDataBuilder);
|
||||
AddressableAssetSettings.BuildPlayerContent();
|
||||
Debug.Log("BuildAddressablesProcessor.PreExport done");
|
||||
}
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void Initialize()
|
||||
{
|
||||
BuildPlayerWindow.RegisterBuildPlayerHandler(BuildPlayerHandler);
|
||||
}
|
||||
|
||||
private static void BuildPlayerHandler(BuildPlayerOptions options)
|
||||
{
|
||||
if (EditorUtility.DisplayDialog("Build with Addressables",
|
||||
"Do you want to build a clean addressables before export?",
|
||||
"Build with Addressables", "Skip"))
|
||||
{
|
||||
PreExport();
|
||||
}
|
||||
BuildPlayerWindow.DefaultBuildMethods.BuildPlayer(options);
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Scripts/Editor/BuildAddressables.cs.meta
Normal file
11
Assets/Scripts/Editor/BuildAddressables.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f8ed19d25e99ba14b887f99d9383a522
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user