Search Results for

    Show / Hide Table of Contents

    Class StaticActor<T>

    This is a generic Singleton implementation for components.
    Create a derived class where the type T is the script you want to "Singletonize"

    Inheritance
    System.Object
    TypeCastObject<EObject>
    EObject
    EActor
    StaticActor<T>
    Implements
    IEntity
    IWorldSpace
    IPosition
    IRotation
    Inherited Members
    EActor.DefaultFixedTickRate
    EActor.ComponentsInChildren
    EActor.Transform
    EActor.Position
    EActor.Rotation
    EActor.Scale
    EActor.CanEverTick
    EActor.FixedTickRate
    EActor.ComponentsInParent
    EActor.AttachTo(EActor, GameObject)
    EActor.AttachTo(EActor, EActor)
    EActor.AddComponent<T>(String)
    EActor.AddComponent(Type, String)
    EActor.AddComponent<T>(Type, String)
    EActor.GetComponent(Type)
    EActor.GetComponent<T>()
    EActor.GetComponent<T>(Type)
    EActor.TryGetComponent<T>(Type, T)
    EActor.TryGetComponent<T>(T)
    EActor.TryGetComponent(Type, EActor)
    EActor.HasComponent<T>(Boolean)
    EActor.HasComponent(Type, Boolean)
    EActor.Tick()
    EActor.SubscribeEvents()
    EActor.UnsubscribeEvents()
    EActor.OnBeginDestroy()
    EObject.RegisteredTypes
    EObject.Base
    EObject.Name
    EObject.Tag
    EObject.IsEditable
    EObject.GetObjectTypeByName(String)
    EObject.RegisterObjectType<T>(String)
    EObject.RegisterObjectType(Type, String)
    EObject.UnregisterObjectType(Type)
    EObject.UnregisterObjectType(String)
    EObject.FindObjectDefinedTypeByName(String, Boolean)
    EObject.GetObjectTypeFromRegisteredTypes<T>()
    EObject.GetObjectTypeFromRegisteredTypes<T>(String)
    EObject.GetObjectTypeFromRegisteredTypes(Type)
    EObject.GetObjectTypeFromRegisteredTypes(Type, String)
    EObject.GetObjectTypeFromRegisteredTypesByName(String)
    EObject.CreateDefaultSubobject(Type, Object[])
    EObject.CreateDefaultSubobject<T>(Type)
    EObject.CreateDefaultSubobject<T>()
    EObject.CreateDefaultSubobject<T>(Object[])
    EObject.CreateDefaultSubobject<T>(GameObject, String)
    EObject.CreateDefaultSubobject<T>(GameObject, String, Object[])
    EObject.CreateDefaultSubobject<T>(Type, GameObject, String)
    EObject.CreateDefaultSubobject<T>(Type, GameObject, String, Object[])
    EObject.CreateDefaultSubobject(Type, GameObject, String)
    EObject.CreateDefaultSubobject(Type, GameObject, String, Object[])
    EObject.DestroyAllObjects()
    EObject.DestroyAllObjectsOfType<T>()
    EObject.FindActiveObjectOfType<T>(Func<EObject, Boolean>)
    EObject.FindActiveObjectsOfType<T>(Func<EObject, Boolean>)
    EObject.FindActiveObjectsOfType<T>()
    EObject.FindActiveObjectsOfType<T>(String)
    EObject.FindActiveObjectsOfType<T>(Type)
    EObject.FindActiveObjectsOfType<T>(Type, Func<EObject, Boolean>)
    EObject.FindActiveObjectsWithTagOfType<T>(String)
    EObject.FindActiveObjectsOfType<T>(Func<Object, Boolean>)
    EObject.FindActiveObjectsOfType<T>(Func<T, Boolean>)
    EObject.DestroyActiveObjectsOfType<T>()
    EObject.DestroyActiveObject<T>(GameObject)
    EObject.DestroyActiveObject(Type, GameObject)
    EObject.FindMostAppropriateEntry<T>(String, IEnumerable<T>)
    EObject.Destroy()
    EObject.GetHashCode()
    EObject.Equals(Object)
    EObject.Destroy(Boolean)
    EObject.OnDestroyed()
    TypeCastObject<EObject>.Cast<TObject>()
    TypeCastObject<EObject>.Cast<TObject>(TObject)
    TypeCastObject<EObject>.As<TObject>()
    TypeCastObject<EObject>.Is<TObject>(TObject)
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features.Core.Generic
    Assembly: Exiled.API.dll
    Syntax
    public abstract class StaticActor<T> : EActor, IEntity, IWorldSpace, IPosition, IRotation where T : EActor
    Type Parameters
    Name Description
    T

    The type of the class.

    Remarks

    Do not redefine PostInitialize() OnBeginPlay() or OnEndPlay() in derived classes.
    Instead, use langword_csharp_protected virtual methods:

    PostInitialize_Static()

    BeginPlay_Static()

    EndPlay_Static()

    To perform the initialization and cleanup: those methods are guaranteed to only be called once in the entire lifetime of the component.

    Properties

    | Improve this Doc View Source

    IsDestroyed

    Gets a value indicating whether the OnEndPlay() method has already been called by Unity.

    Declaration
    public bool IsDestroyed { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsInitialized

    Gets a value indicating whether the PostInitialize() method has already been called by Unity.

    Declaration
    public bool IsInitialized { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsStarted

    Gets a value indicating whether the OnBeginPlay() method has already been called by Unity.

    Declaration
    public bool IsStarted { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    BeginPlay_Static()

    Fired on OnBeginPlay().

    Declaration
    protected virtual void BeginPlay_Static()
    Remarks

    This method will only be called once even if multiple instances of the StaticActor<T> component exist in the scene.
    You can override this method in derived classes to customize the initialization of the component.

    | Improve this Doc View Source

    CreateNewInstance()

    Creates a new instance of the StaticActor<T>.

    Declaration
    public static T CreateNewInstance()
    Returns
    Type Description
    T

    The created T instance, or null if not found.

    | Improve this Doc View Source

    EndPlay_Static()

    Fired on OnEndPlay().

    Declaration
    protected virtual void EndPlay_Static()
    Remarks

    This method will only be called once even if multiple instances of the StaticActor<T> component exist in the scene.
    You can override this method in derived classes to customize the initialization of the component.

    | Improve this Doc View Source

    FindExistingInstance()

    Looks for an existing instance of the StaticActor<T>.

    Declaration
    public static T FindExistingInstance()
    Returns
    Type Description
    T

    The existing T instance, or null if not found.

    | Improve this Doc View Source

    Flush()

    Flushes the current actor.

    Declaration
    protected virtual void Flush()
    | Improve this Doc View Source

    Get()

    Gets or creates a new instance of StaticActor<T>.

    Declaration
    public static T Get()
    Returns
    Type Description
    T

    The found or created T instance.

    | Improve this Doc View Source

    NotifyInstanceRepeated()

    If a duplicated instance of a StaticActor<T> component is loaded into the scene this method will be called instead of PostInitialize_Static().
    That way you can customize what to do with repeated instances.

    Declaration
    protected virtual void NotifyInstanceRepeated()
    Remarks

    The default approach is delete the duplicated component.

    | Improve this Doc View Source

    OnBeginPlay()

    Declaration
    protected override void OnBeginPlay()
    Overrides
    EActor.OnBeginPlay()
    | Improve this Doc View Source

    OnEndPlay()

    Declaration
    protected override void OnEndPlay()
    Overrides
    EActor.OnEndPlay()
    | Improve this Doc View Source

    PostInitialize()

    Declaration
    protected override void PostInitialize()
    Overrides
    EActor.PostInitialize()
    | Improve this Doc View Source

    PostInitialize_Static()

    Fired on PostInitialize().

    Declaration
    protected virtual void PostInitialize_Static()
    Remarks

    This method will only be called once even if multiple instances of the StaticActor<T> component exist in the scene.
    You can override this method in derived classes to customize the initialization of the component.

    Implements

    IEntity
    IWorldSpace
    IPosition
    IRotation

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX