Version 3.3.1.2

UnityPropertyEmitter class

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public static class UnityPropertyEmitter
Provides utilities for emitting ScriptableObject and MonoBehaviour-derived types with specific property names and types, and providing instances of UnityEditor.SerializedProperty with those names and types.
Inheritance
  • System.Object
  • UnityPropertyEmitter

Fields

EMIT_ASSEMBLY_NAME
public const string EMIT_ASSEMBLY_NAME = "Sirenix.OdinInspector.EmittedUnityProperties"
HOST_GO_HIDE_FLAGS
public const HideFlags HOST_GO_HIDE_FLAGS
HOST_GO_NAME
public const string HOST_GO_NAME = "ODIN_EMIT_HOST_GO_ac922281-4f8a-4e1b-8a45-65af1a8350b3"

Methods

CreateEmittedMonoBehaviourProperty(String, Type, Int32, ref GameObject)
Creates an emitted MonoBehaviour-based UnityEditor.SerializedProperty.
public static UnityPropertyEmitter.Handle CreateEmittedMonoBehaviourProperty(string fieldName, Type valueType, int targetCount, ref GameObject gameObject)
Parameters
System.String fieldName

Name of the field to emit.

System.Type valueType

Type of the value to create a property for.

System.Int32 targetCount

The target count of the tree to create a property for.

UnityEngine.GameObject gameObject

The game object that the MonoBehaviour of the property is located on.

Exceptions
System.ArgumentNullException

fieldName is null or valueType is null

System.ArgumentException

Target count must be equal to or higher than 1.

CreateEmittedScriptableObjectProperty(String, Type, Int32)
Creates an emitted ScriptableObject-based UnityEditor.SerializedProperty.
public static SerializedProperty CreateEmittedScriptableObjectProperty(string fieldName, Type valueType, int targetCount)
Parameters
System.String fieldName

Name of the field to emit.

System.Type valueType

Type of the value to create a property for.

System.Int32 targetCount

The target count of the tree to create a property for.

Returns
UnityEditor.SerializedProperty

Exceptions
System.ArgumentNullException

fieldName is null or valueType is null

System.ArgumentException

Target count must be equal to or higher than 1.