Depiction Engine For Unity 2023.0 (Alpha)
Loading...
Searching...
No Matches
DepictionEngine.MemberUtility Class Reference

Utility methods to help interact with members and attributes. More...

Static Public Member Functions

static object GetMemberInfoFromPropertyPath< T > (object targetObject, string propertyPath)
 
static bool GetMethodInfoFromMethodName (object targetObject, string methodName, out MethodInfo member)
 
static bool GetMemberInfoFromMemberName< T > (Type targetObjectType, string memberName, out T member)
 
static T GetFirstAttribute< T > (IEnumerable< CustomAttribute > attributes)
 
static IEnumerable< T > GetAllAttributes< T > (object targetObject, bool inherit=true)
 
static IEnumerable< T > GetAllAttributes< T > (Type classType, bool inherit=true)
 Retrieves a collection of custom attributes of a specified type T in a specific Class, and optionally inspects the ancestors of that member.
 
static IEnumerable< T > GetMemberAttributes< T > (object targetObject, string propertyPath)
 
static object GetPropertyValue (IJson iJson, TypeAccessor accessor, PropertyInfo propertyInfo)
 
static void SetPropertyValue (IJson iJson, TypeAccessor accessor, PropertyInfo propertyInfo, object value)
 
static TypeAccessor GetTypeAccessor (Type type)
 
static void GetRequiredComponentTypes (ref List< Type > types, Type classType, bool includeCreateComponentAttribute=true)
 Populate a list with the UnityEngine.RequireComponent && optionally DepictionEngine.CreateComponentAttribute attribute types found in a specific Class.
 

Static Public Attributes

static T
 

Detailed Description

Utility methods to help interact with members and attributes.

Member Function Documentation

◆ GetAllAttributes< T >() [1/2]

static IEnumerable< T > DepictionEngine.MemberUtility.GetAllAttributes< T > ( object  targetObject,
bool  inherit = true 
)
static
Type Constraints
T :Attribute 

◆ GetAllAttributes< T >() [2/2]

static IEnumerable< T > DepictionEngine.MemberUtility.GetAllAttributes< T > ( Type  classType,
bool  inherit = true 
)
static

Retrieves a collection of custom attributes of a specified type T in a specific Class, and optionally inspects the ancestors of that member.

Parameters
classTypeThe class type in which attributes should be found.
inherittrue to inspect the ancestors of element; otherwise, false.
Returns
A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist.
Type Constraints
T :Attribute 

◆ GetFirstAttribute< T >()

static T DepictionEngine.MemberUtility.GetFirstAttribute< T > ( IEnumerable< CustomAttribute attributes)
static
Type Constraints
T :CustomAttribute 

◆ GetMemberAttributes< T >()

static IEnumerable< T > DepictionEngine.MemberUtility.GetMemberAttributes< T > ( object  targetObject,
string  propertyPath 
)
static
Type Constraints
T :Attribute 

◆ GetMemberInfoFromMemberName< T >()

static bool DepictionEngine.MemberUtility.GetMemberInfoFromMemberName< T > ( Type  targetObjectType,
string  memberName,
out T  member 
)
static
Type Constraints
T :MemberInfo 

◆ GetMemberInfoFromPropertyPath< T >()

static object DepictionEngine.MemberUtility.GetMemberInfoFromPropertyPath< T > ( object  targetObject,
string  propertyPath 
)
static
Type Constraints
T :MemberInfo 

◆ GetRequiredComponentTypes()

static void DepictionEngine.MemberUtility.GetRequiredComponentTypes ( ref List< Type >  types,
Type  classType,
bool  includeCreateComponentAttribute = true 
)
static

Populate a list with the UnityEngine.RequireComponent && optionally DepictionEngine.CreateComponentAttribute attribute types found in a specific Class.

Parameters
typesThe reference to the list that will be populated. The list will be cleared first.
classTypeThe class type in which attributes should be found.
includeCreateComponentAttributetrue to include DepictionEngine.CreateComponentAttribute.
Returns

The documentation for this class was generated from the following file: