Skip to content

Instantly share code, notes, and snippets.

@favoyang
favoyang / BuildAddressables.cs
Last active Dec 18, 2021
Build addressable bundles when clicking the build button
View BuildAddressables.cs
/// <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 Oct 19, 2016
A PropertyDrawer to show a popup field with a generic list of string for your Unity3d attribute
View ExampleBehavior.cs
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;
}