### Install via Open UPM Source: https://github.com/mackysoft/unity-serializereferenceextensions/blob/main/README.md Install the package using the OpenUPM CLI by running the provided command in your terminal. ```bash openupm add com.mackysoft.serializereference-extensions ``` -------------------------------- ### Install via Git URL Source: https://github.com/mackysoft/unity-serializereferenceextensions/blob/main/README.md Install the package by adding the git URL to Unity's Package Manager. To pin a specific version, append the version number after a '#'. ```bash https://github.com/mackysoft/Unity-SerializeReferenceExtensions.git?path=Assets/MackySoft/MackySoft.SerializeReferenceExtensions#1.7.0 ``` -------------------------------- ### Basic Usage of SubclassSelector Source: https://github.com/mackysoft/unity-serializereferenceextensions/blob/main/README.md Apply the [SerializeReference] and [SubclassSelector] attributes to an interface field to enable a dropdown for selecting concrete implementations. Supports collections and provides execution logic in Start. ```csharp using System; using UnityEngine; public class Example : MonoBehaviour { // The type that implements ICommand will be displayed in the popup. [SerializeReference, SubclassSelector] ICommand m_Command; // Collection support [SerializeReference, SubclassSelector] ICommand[] m_Commands = Array.Empty(); void Start () { m_Command?.Execute(); foreach (ICommand command in m_Commands) { command?.Execute(); } } // Nested type support [Serializable] public class NestedCommand : ICommand { public void Execute () { Debug.Log("Execute NestedCommand"); } } } public interface ICommand { void Execute (); } [Serializable] public class DebugCommand : ICommand { [SerializeField] string m_Message; public void Execute () { Debug.Log(m_Message); } } [Serializable] public class InstantiateCommand : ICommand { [SerializeField] GameObject m_Prefab; public void Execute () { UnityEngine.Object.Instantiate(m_Prefab,Vector3.zero,Quaternion.identity); } } // Menu override support [AddTypeMenu("Example/Add Type Menu Command")] [Serializable] public class AddTypeMenuCommand : ICommand { public void Execute () { Debug.Log("Execute AddTypeMenuCommand"); } } [Serializable] public struct StructCommand : ICommand { public void Execute () { Debug.Log("Execute StructCommand"); } } ``` -------------------------------- ### Run EditMode Tests Locally Source: https://github.com/mackysoft/unity-serializereferenceextensions/blob/main/AGENTS.md Execute EditMode tests for the project using Unity's batchmode. Ensure UNITY_EXE is set to your Unity executable path. This command generates an XML report of the test results. ```bash PROJECT_ROOT="$(pwd)" RESULT_XML="$PROJECT_ROOT/TestResults/editmode.xml" mkdir -p "$(dirname "$RESULT_XML")" "" -batchmode -nographics -quit \ -projectPath "$PROJECT_ROOT" \ -runTests -testPlatform editmode \ -testResults "$RESULT_XML" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.