Skip to content

Instantly share code, notes, and snippets.

@favoyang
favoyang / BuildAddressables.cs
Last active August 14, 2023 06:29
Build addressable bundles when clicking the build button
/// <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;
@ProGM
ProGM / ExampleBehavior.cs
Created October 19, 2016 10:39
A PropertyDrawer to show a popup field with a generic list of string for your Unity3d attribute
public class MyBehavior : MonoBehaviour {
// This will store the string value
[StringInList("Cat", "Dog")] public string Animal;
// This will store the index of the array value
[StringInList("John", "Jack", "Jim")] public int PersonID;
// Showing a list of loaded scenes
[StringInList(typeof(PropertyDrawersHelper), "AllSceneNames")] public string SceneName;
}