Table of Contents

Class EObject

Namespace
Exiled.API.Features.Core
Assembly
Exiled.API.dll

The base class of all Exiled objects.

public abstract class EObject : TypeCastObject<EObject>
Inheritance
EObject
Derived
Inherited Members
Extension Methods

Constructors

EObject()

Initializes a new instance of the EObject class.

protected EObject()

EObject(GameObject)

Initializes a new instance of the EObject class.

protected EObject(GameObject gameObject = null)

Parameters

gameObject GameObject

Properties

Base

Gets or sets the base UnityEngine.GameObject.

public GameObject Base { get; set; }

Property Value

GameObject

IsEditable

Gets or sets a value indicating whether the EObject values can be edited.

public bool IsEditable { get; set; }

Property Value

bool

Name

Gets or sets the name of the EObject instance.

public string Name { get; set; }

Property Value

string

RegisteredTypes

Gets all the registered EObject types.

public static IReadOnlyDictionary<Type, List<string>> RegisteredTypes { get; }

Property Value

IReadOnlyDictionary<Type, List<string>>

Tag

Gets or sets the tag of the EObject instance.

public string Tag { get; set; }

Property Value

string

Methods

CreateDefaultSubobject(Type, params object[])

Creates a new instance of the EObject class.

public static EObject CreateDefaultSubobject(Type type, params object[] parameters)

Parameters

type Type

The EObject type.

parameters object[]

The parameters to initialize the object.

Returns

EObject

The new EObject instance.

CreateDefaultSubobject(Type, GameObject, string)

Creates a new instance of the EObject class.

public static EObject CreateDefaultSubobject(Type type, GameObject gameObject, string name)

Parameters

type Type

The EObject type.

gameObject GameObject
name string

The name to be given to the new EObject instance.

Returns

EObject

The new EObject instance.

CreateDefaultSubobject(Type, GameObject, string, params object[])

Creates a new instance of the EObject class.

public static EObject CreateDefaultSubobject(Type type, GameObject gameObject, string name, params object[] parameters)

Parameters

type Type

The EObject type.

gameObject GameObject
name string

The name to be given to the new EObject instance.

parameters object[]

The parameters to initialize the object.

Returns

EObject

The new EObject instance.

CreateDefaultSubobject<T>()

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>() where T : EObject

Returns

T

The new EObject instance.

Type Parameters

T

The cast EObject type.

CreateDefaultSubobject<T>(params object[])

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(params object[] parameters) where T : EObject

Parameters

parameters object[]

The parameters to initialize the object.

Returns

T

The new EObject instance.

Type Parameters

T

The EObject type to cast.

CreateDefaultSubobject<T>(Type)

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(Type type) where T : EObject

Parameters

type Type

The EObject type.

Returns

T

The new EObject instance.

Type Parameters

T

The cast EObject type.

CreateDefaultSubobject<T>(Type, GameObject, string)

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(Type type, GameObject gameObject, string name) where T : EObject

Parameters

type Type

The EObject type.

gameObject GameObject
name string

The name to be given to the new EObject instance.

Returns

T

The new EObject instance.

Type Parameters

T

The cast EObject type.

CreateDefaultSubobject<T>(Type, GameObject, string, params object[])

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(Type type, GameObject gameObject, string name, params object[] parameters) where T : EObject

Parameters

type Type

The EObject type.

gameObject GameObject
name string

The name to be given to the new EObject instance.

parameters object[]

The parameters to initialize the object.

Returns

T

The new EObject instance.

Type Parameters

T

The cast EObject type.

CreateDefaultSubobject<T>(GameObject, string)

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(GameObject gameObject, string name) where T : EObject

Parameters

gameObject GameObject
name string

The name to be given to the new EObject instance.

Returns

T

The new EObject instance.

Type Parameters

T

The EObject type.

CreateDefaultSubobject<T>(GameObject, string, params object[])

Creates a new instance of the EObject class.

public static T CreateDefaultSubobject<T>(GameObject gameObject, string name, params object[] parameters) where T : EObject

Parameters

gameObject GameObject
name string

The name to be given to the new EObject instance.

parameters object[]

The parameters to initialize the object.

Returns

T

The new EObject instance.

Type Parameters

T

The EObject type.

Destroy()

Destroys the current EObject instance.

public void Destroy()

Destroy(bool)

Destroys the current EObject instance.

protected virtual void Destroy(bool destroying)

Parameters

destroying bool

DestroyActiveObject(Type, GameObject)

Destroys an active EObject instance given the specified UnityEngine.GameObject.

public static bool DestroyActiveObject(Type type, GameObject gameObject)

Parameters

type Type

The type of the object.

gameObject GameObject

The UnityEngine.GameObject belonging to the object.

Returns

bool

true if the object was destroyed; otherwise, false.

DestroyActiveObject<T>(GameObject)

Destroys an active EObject instance of type T given the specified UnityEngine.GameObject.

public static bool DestroyActiveObject<T>(GameObject gameObject) where T : EObject

Parameters

gameObject GameObject

The UnityEngine.GameObject belonging to the EObject instance to be destroyed.

Returns

bool

true if the object was destroyed; otherwise, false.

Type Parameters

T

The T type to look for.

DestroyActiveObjectsOfType<T>()

Destroys all the active EObject instances of type T.

public static void DestroyActiveObjectsOfType<T>() where T : EObject

Type Parameters

T

The T type to look for.

DestroyAllObjects()

Destroys all the active EObject instances.

public static void DestroyAllObjects()

DestroyAllObjectsOfType<T>()

Destroys all the active T EObject instances.

public static void DestroyAllObjectsOfType<T>() where T : EObject

Type Parameters

T

The T type to look for.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

FindActiveObjectOfType<T>(Func<EObject, bool>)

Finds the active EObject instances of type T filtered based on a predicate.

public static T FindActiveObjectOfType<T>(Func<EObject, bool> predicate) where T : EObject

Parameters

predicate Func<EObject, bool>

The condition to satify.

Returns

T

The corresponding active T EObject.

Type Parameters

T

The T type to look for.

FindActiveObjectsOfType<T>()

Finds all the active EObject instances of type T.

public static T[] FindActiveObjectsOfType<T>() where T : EObject

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindActiveObjectsOfType<T>(Func<EObject, bool>)

Finds all the active EObject instances of type T filtered based on a predicate.

public static T[] FindActiveObjectsOfType<T>(Func<EObject, bool> predicate) where T : EObject

Parameters

predicate Func<EObject, bool>

The condition to satify.

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindActiveObjectsOfType<T>(Func<object, bool>)

Finds all the active EObject instances of type T.

public static T[] FindActiveObjectsOfType<T>(Func<object, bool> predicate) where T : EObject

Parameters

predicate Func<object, bool>

The condition to satify.

Returns

T[]

A T[] containing all the elements that satify the condition.

Type Parameters

T

The type to look for.

FindActiveObjectsOfType<T>(Func<T, bool>)

Finds all the active EObject instances of type T.

public static T[] FindActiveObjectsOfType<T>(Func<T, bool> predicate) where T : EObject

Parameters

predicate Func<T, bool>

The condition to satify.

Returns

T[]

A T[] containing all the elements that satify the condition.

Type Parameters

T

The type to look for.

FindActiveObjectsOfType<T>(string)

Finds all the active EObject instances of type T with the specified name.

public static T[] FindActiveObjectsOfType<T>(string name) where T : EObject

Parameters

name string

The name to look for.

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindActiveObjectsOfType<T>(Type)

Finds all the active EObject instances of type T.

public static T[] FindActiveObjectsOfType<T>(Type type) where T : EObject

Parameters

type Type

The EObject type.

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindActiveObjectsOfType<T>(Type, Func<EObject, bool>)

Finds all the active EObject instances of type T filtered based on a predicate.

public static T[] FindActiveObjectsOfType<T>(Type type, Func<EObject, bool> predicate) where T : EObject

Parameters

type Type

The EObject type.

predicate Func<EObject, bool>

The condition to satify.

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindActiveObjectsWithTagOfType<T>(string)

Finds all the active EObject instances of type T with the specified tag.

public static T[] FindActiveObjectsWithTagOfType<T>(string tag) where T : EObject

Parameters

tag string

The tag to look for.

Returns

T[]

A T[] containing all the matching results.

Type Parameters

T

The T type to look for.

FindMostAppropriateEntry<T>(string, IEnumerable<T>)

Finds the most appropriate entry.

public static T FindMostAppropriateEntry<T>(string name, IEnumerable<T> source)

Parameters

name string

The name to pair.

source IEnumerable<T>

The source on which iterate on.

Returns

T

The corresponding entry or default if not found.

Type Parameters

T

The type to look for.

FindObjectDefinedTypeByName(string, bool)

Finds the most accurate Type matching the given name.

public static Type FindObjectDefinedTypeByName(string name, bool ignoreAbstractTypes = true)

Parameters

name string

The name to look for.

ignoreAbstractTypes bool

A value indicating whether abstract types should be ignored.

Returns

Type

The Type with the name that matches the given name.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetObjectTypeByName(string)

Gets a Type from a given type name.

public static Type GetObjectTypeByName(string typeName)

Parameters

typeName string

The type name to look for.

Returns

Type

A Type matching the type name or null if not found.

GetObjectTypeFromRegisteredTypes(Type)

Gets a EObject type from all the registered types.

public static Type GetObjectTypeFromRegisteredTypes(Type type)

Parameters

type Type

The EObject type.

Returns

Type

The matching Type.

Exceptions

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.

public static Type GetObjectTypeFromRegisteredTypes(Type type, string name)

Parameters

type Type

The EObject type.

name string

The name of the type to look for.

Returns

Type

The matching Type.

Exceptions

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.

public static Type GetObjectTypeFromRegisteredTypesByName(string name)

Parameters

name string

The name of the type to look for.

Returns

Type

The matching Type.

Exceptions

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.

public static Type GetObjectTypeFromRegisteredTypes<T>() where T : EObject

Returns

Type

The matching Type.

Type Parameters

T

The EObject type.

Exceptions

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.

public static Type GetObjectTypeFromRegisteredTypes<T>(string name) where T : EObject

Parameters

name string

The name of the type to look for.

Returns

Type

The matching Type.

Type Parameters

T

The EObject type.

Exceptions

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.

protected virtual void OnBeginDestroy()

OnDestroyed()

Fired when the current EObject instance has been explicitly destroyed.

protected virtual void OnDestroyed()

RegisterObjectType(Type, string)

Registers the specified EObject type.

public static Type RegisterObjectType(Type type, string name)

Parameters

type Type

The type to register.

name string

The name of the registered type.

Returns

Type

The registered Type.

RegisterObjectType<T>(string)

Registers the specified EObject type T.

public static Type RegisterObjectType<T>(string name) where T : EObject

Parameters

name string

The name of the registered type.

Returns

Type

The registered Type.

Type Parameters

T

The type to register.

UnregisterObjectType(string)

Unregisters the specified EObject type.

public static bool UnregisterObjectType(string name)

Parameters

name string

The name of the type to unregister.

Returns

bool

true if the type was unregistered successfully; otherwise, false.

UnregisterObjectType(Type)

Registers the specified EObject type.

public static bool UnregisterObjectType(Type type)

Parameters

type Type

The type to register.

Returns

bool

true if the type was unregistered successfully; otherwise, false.

Operators

implicit operator bool(EObject)

Implicitly converts the given EObject instance to a bool.

public static implicit operator bool(EObject @object)

Parameters

object EObject

Whether the EObject instance exists.

Returns

bool

implicit operator string(EObject)

Implicitly converts the given EObject instance to a string.

public static implicit operator string(EObject @object)

Parameters

object EObject

The EObject instance's name.

Returns

string