Class EObject
The base class of all Exiled objects.
Inherited Members
Namespace: Exiled.API.Features.Core
Assembly: Exiled.API.dll
Syntax
public abstract class EObject : TypeCastObject<EObject>
Constructors
| Improve this Doc View SourceEObject()
Initializes a new instance of the EObject class.
Declaration
protected EObject()
EObject(GameObject)
Initializes a new instance of the EObject class.
Declaration
protected EObject(GameObject gameObject = null)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | gameObject |
Properties
| Improve this Doc View SourceBase
Gets or sets the base UnityEngine.GameObject.
Declaration
public GameObject Base { get; set; }
Property Value
Type | Description |
---|---|
UnityEngine.GameObject |
IsEditable
Gets or sets a value indicating whether the EObject values can be edited.
Declaration
public bool IsEditable { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets or sets the name of the EObject instance.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RegisteredTypes
Gets all the registered EObject types.
Declaration
public static IReadOnlyDictionary<Type, List<string>> RegisteredTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<System.Type, System.Collections.Generic.List<System.String>> |
Tag
Gets or sets the tag of the EObject instance.
Declaration
public string Tag { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceCreateDefaultSubobject(Type, Object[])
Creates a new instance of the EObject class.
Declaration
public static EObject CreateDefaultSubobject(Type type, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
System.Object[] | parameters | The parameters to initialize the object. |
Returns
Type | Description |
---|---|
EObject | The new EObject instance. |
CreateDefaultSubobject(Type, GameObject, String)
Creates a new instance of the EObject class.
Declaration
public static EObject CreateDefaultSubobject(Type type, GameObject gameObject, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
Returns
Type | Description |
---|---|
EObject | The new EObject instance. |
CreateDefaultSubobject(Type, GameObject, String, Object[])
Creates a new instance of the EObject class.
Declaration
public static EObject CreateDefaultSubobject(Type type, GameObject gameObject, string name, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
System.Object[] | parameters | The parameters to initialize the object. |
Returns
Type | Description |
---|---|
EObject | The new EObject instance. |
CreateDefaultSubobject<T>()
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>()
where T : EObject
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The cast EObject type. |
CreateDefaultSubobject<T>(Object[])
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(params object[] parameters)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | parameters | The parameters to initialize the object. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The EObject type to cast. |
CreateDefaultSubobject<T>(Type)
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(Type type)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The cast EObject type. |
CreateDefaultSubobject<T>(Type, GameObject, String)
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(Type type, GameObject gameObject, string name)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The cast EObject type. |
CreateDefaultSubobject<T>(Type, GameObject, String, Object[])
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(Type type, GameObject gameObject, string name, params object[] parameters)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
System.Object[] | parameters | The parameters to initialize the object. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The cast EObject type. |
CreateDefaultSubobject<T>(GameObject, String)
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(GameObject gameObject, string name)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The EObject type. |
CreateDefaultSubobject<T>(GameObject, String, Object[])
Creates a new instance of the EObject class.
Declaration
public static T CreateDefaultSubobject<T>(GameObject gameObject, string name, params object[] parameters)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | gameObject | |
System.String | name | The name to be given to the new EObject instance. |
System.Object[] | parameters | The parameters to initialize the object. |
Returns
Type | Description |
---|---|
T | The new EObject instance. |
Type Parameters
Name | Description |
---|---|
T | The EObject type. |
Destroy()
Destroys the current EObject instance.
Declaration
public void Destroy()
Destroy(Boolean)
Declaration
protected virtual void Destroy(bool destroying)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | destroying |
DestroyActiveObject(Type, GameObject)
Destroys an active EObject instance given the specified UnityEngine.GameObject.
Declaration
public static bool DestroyActiveObject(Type type, GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type of the object. |
UnityEngine.GameObject | gameObject | The UnityEngine.GameObject belonging to the object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the object was destroyed; otherwise, false. |
DestroyActiveObject<T>(GameObject)
Destroys an active EObject instance of type T
given the specified UnityEngine.GameObject.
Declaration
public static bool DestroyActiveObject<T>(GameObject gameObject)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | gameObject | The UnityEngine.GameObject belonging to the EObject instance to be destroyed. |
Returns
Type | Description |
---|---|
System.Boolean | true if the object was destroyed; otherwise, false. |
Type Parameters
Name | Description |
---|---|
T | The |
DestroyActiveObjectsOfType<T>()
Destroys all the active EObject instances of type T
.
Declaration
public static void DestroyActiveObjectsOfType<T>()
where T : EObject
Type Parameters
Name | Description |
---|---|
T | The |
DestroyAllObjects()
Destroys all the active EObject instances.
Declaration
public static void DestroyAllObjects()
DestroyAllObjectsOfType<T>()
Destroys all the active T
EObject instances.
Declaration
public static void DestroyAllObjectsOfType<T>()
where T : EObject
Type Parameters
Name | Description |
---|---|
T | The |
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
System.Object | other |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
FindActiveObjectOfType<T>(Func<EObject, Boolean>)
Finds the active EObject instances of type T
filtered based on a predicate.
Declaration
public static T FindActiveObjectOfType<T>(Func<EObject, bool> predicate)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Func<EObject, System.Boolean> | predicate | The condition to satify. |
Returns
Type | Description |
---|---|
T | The corresponding active |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsOfType<T>()
Finds all the active EObject instances of type T
.
Declaration
public static T[] FindActiveObjectsOfType<T>()
where T : EObject
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsOfType<T>(Func<T, Boolean>)
Finds all the active EObject instances of type T
.
Declaration
public static T[] FindActiveObjectsOfType<T>(Func<T, bool> predicate)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, System.Boolean> | predicate | The condition to satify. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The type to look for. |
FindActiveObjectsOfType<T>(Func<EObject, Boolean>)
Finds all the active EObject instances of type T
filtered based on a predicate.
Declaration
public static T[] FindActiveObjectsOfType<T>(Func<EObject, bool> predicate)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Func<EObject, System.Boolean> | predicate | The condition to satify. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsOfType<T>(Func<Object, Boolean>)
Finds all the active EObject instances of type T
.
Declaration
public static T[] FindActiveObjectsOfType<T>(Func<object, bool> predicate)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Object, System.Boolean> | predicate | The condition to satify. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The type to look for. |
FindActiveObjectsOfType<T>(String)
Finds all the active EObject instances of type T
with the specified name
.
Declaration
public static T[] FindActiveObjectsOfType<T>(string name)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name to look for. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsOfType<T>(Type)
Finds all the active EObject instances of type T
.
Declaration
public static T[] FindActiveObjectsOfType<T>(Type type)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsOfType<T>(Type, Func<EObject, Boolean>)
Finds all the active EObject instances of type T
filtered based on a predicate.
Declaration
public static T[] FindActiveObjectsOfType<T>(Type type, Func<EObject, bool> predicate)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
System.Func<EObject, System.Boolean> | predicate | The condition to satify. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindActiveObjectsWithTagOfType<T>(String)
Finds all the active EObject instances of type T
with the specified tag
.
Declaration
public static T[] FindActiveObjectsWithTagOfType<T>(string tag)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.String | tag | The tag to look for. |
Returns
Type | Description |
---|---|
T[] | A |
Type Parameters
Name | Description |
---|---|
T | The |
FindMostAppropriateEntry<T>(String, IEnumerable<T>)
Finds the most appropriate entry.
Declaration
public static T FindMostAppropriateEntry<T>(string name, IEnumerable<T> source)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name to pair. |
System.Collections.Generic.IEnumerable<T> | source | The source on which iterate on. |
Returns
Type | Description |
---|---|
T | The corresponding entry or langword_csharp_default if not found. |
Type Parameters
Name | Description |
---|---|
T | The type to look for. |
FindObjectDefinedTypeByName(String, Boolean)
Finds the most accurate System.Type matching the given name
.
Declaration
public static Type FindObjectDefinedTypeByName(string name, bool ignoreAbstractTypes = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name to look for. |
System.Boolean | ignoreAbstractTypes | A value indicating whether abstract types should be ignored. |
Returns
Type | Description |
---|---|
System.Type | The System.Type with the name that matches the given name. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetObjectTypeByName(String)
Gets a System.Type from a given type name.
Declaration
public static Type GetObjectTypeByName(string typeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The type name to look for. |
Returns
Type | Description |
---|---|
System.Type | A System.Type matching the type name or null if not found. |
GetObjectTypeFromRegisteredTypes(Type)
Gets a EObject type from all the registered types.
Declaration
public static Type GetObjectTypeFromRegisteredTypes(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
Returns
Type | Description |
---|---|
System.Type | The matching System.Type. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Occurs when the requested type is not the same as the specified type. |
GetObjectTypeFromRegisteredTypes(Type, String)
Gets a EObject type from all the registered types.
Declaration
public static Type GetObjectTypeFromRegisteredTypes(Type type, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The EObject type. |
System.String | name | The name of the type to look for. |
Returns
Type | Description |
---|---|
System.Type | The matching System.Type. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Occurs when the requested type's name is not the same as the specified name. |
GetObjectTypeFromRegisteredTypes<T>()
Gets a EObject type from all the registered types.
Declaration
public static Type GetObjectTypeFromRegisteredTypes<T>()
where T : EObject
Returns
Type | Description |
---|---|
System.Type | The matching System.Type. |
Type Parameters
Name | Description |
---|---|
T | The EObject type. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Occurs when the requested type is not the same as the specified type. |
GetObjectTypeFromRegisteredTypes<T>(String)
Gets a EObject type from all the registered types.
Declaration
public static Type GetObjectTypeFromRegisteredTypes<T>(string name)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the type to look for. |
Returns
Type | Description |
---|---|
System.Type | The matching System.Type. |
Type Parameters
Name | Description |
---|---|
T | The EObject type. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Occurs when the requested type's name is not the same as the specified name. |
GetObjectTypeFromRegisteredTypesByName(String)
Gets a EObject type from all the registered types.
Declaration
public static Type GetObjectTypeFromRegisteredTypesByName(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the type to look for. |
Returns
Type | Description |
---|---|
System.Type | The matching System.Type. |
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | Occurs when the requested type's name is not the same as the specified name. |
OnBeginDestroy()
Fired before the current EObject instance is destroyed.
Declaration
protected virtual void OnBeginDestroy()
OnDestroyed()
Fired when the current EObject instance has been explicitly destroyed.
Declaration
protected virtual void OnDestroyed()
RegisterObjectType(Type, String)
Registers the specified EObject type
.
Declaration
public static Type RegisterObjectType(Type type, string name)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to register. |
System.String | name | The name of the registered type. |
Returns
Type | Description |
---|---|
System.Type | The registered System.Type. |
RegisterObjectType<T>(String)
Registers the specified EObject type T
.
Declaration
public static Type RegisterObjectType<T>(string name)
where T : EObject
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the registered type. |
Returns
Type | Description |
---|---|
System.Type | The registered System.Type. |
Type Parameters
Name | Description |
---|---|
T | The type to register. |
UnregisterObjectType(String)
Unregisters the specified EObject type.
Declaration
public static bool UnregisterObjectType(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the type to unregister. |
Returns
Type | Description |
---|---|
System.Boolean | true if the type was unregistered successfully; otherwise, false. |
UnregisterObjectType(Type)
Registers the specified EObject type.
Declaration
public static bool UnregisterObjectType(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type to register. |
Returns
Type | Description |
---|---|
System.Boolean | true if the type was unregistered successfully; otherwise, false. |
Operators
| Improve this Doc View SourceImplicit(EObject to Boolean)
Implicitly converts the given EObject instance to a System.Boolean.
Declaration
public static implicit operator bool (EObject object)
Parameters
Type | Name | Description |
---|---|---|
EObject | object | Whether the EObject instance exists. |
Returns
Type | Description |
---|---|
System.Boolean |
Implicit(EObject to String)
Implicitly converts the given EObject instance to a System.String.
Declaration
public static implicit operator string (EObject object)
Parameters
Type | Name | Description |
---|---|---|
EObject | object | The EObject instance's name. |
Returns
Type | Description |
---|---|
System.String |