docs.unity3d.com
    Show / Hide Table of Contents

    Class ActorSystem

    Inheritance
    Object
    ActorSystem
    Namespace: Unity.Reflect.ActorFramework
    Syntax
    public class ActorSystem

    Constructors

    ActorSystem(Scheduler)

    Declaration
    public ActorSystem(Scheduler scheduler)
    Parameters
    Type Name Description
    Scheduler scheduler

    Fields

    RefToComponents

    Small hack to track components not referenced directly by actors so the GC does not collect them. This will be removed in the future when a common base class can be inherited (ReflectActor) instead of IActor and IAsyncActor

    Declaration
    public Dictionary<ActorHandle, Dictionary<Type, object>> RefToComponents
    Field Value
    Type Description
    Dictionary<ActorHandle, Dictionary<Type, Object>>

    Properties

    Dependencies

    Declaration
    public Dictionary<Type, object> Dependencies { set; }
    Property Value
    Type Description
    Dictionary<Type, Object>

    PlayerClient

    Declaration
    public IPlayerClient PlayerClient { get; set; }
    Property Value
    Type Description
    IPlayerClient

    Token

    Declaration
    public CancellationToken Token { get; }
    Property Value
    Type Description
    CancellationToken

    Methods

    Add<TState>(Actor<TState>, Dictionary<Type, Object>)

    Declaration
    public void Add<TState>(Actor<TState> actor, Dictionary<Type, object> components)
        where TState : class
    Parameters
    Type Name Description
    Actor<TState> actor
    Dictionary<Type, Object> components
    Type Parameters
    Name Description
    TState

    DisposeDependencies()

    Declaration
    public void DisposeDependencies()

    GetActorHandle<TState>()

    Gets the first matching actor handle for the actor state .

    Declaration
    public ActorHandle GetActorHandle<TState>()
        where TState : class
    Returns
    Type Description
    ActorHandle
    Type Parameters
    Name Description
    TState

    The type of the actor state.

    Exceptions
    Type Condition
    KeyNotFoundException

    No actor of type is currently instantiated in the actor system.

    GetActorState<TState>()

    Gets the first matching actor for type and returns its internal state.

    Declaration
    public TState GetActorState<TState>()
        where TState : class
    Returns
    Type Description
    TState

    The state of the actor.

    Type Parameters
    Name Description
    TState
    Exceptions
    Type Condition
    KeyNotFoundException

    No actor of type is currently instantiated in the actor system.

    PreStop()

    Declaration
    public void PreStop()

    Remove(ActorHandle)

    Declaration
    public void Remove(ActorHandle handle)
    Parameters
    Type Name Description
    ActorHandle handle

    Shutdown()

    Declaration
    public void Shutdown()

    Start()

    Declaration
    public void Start()

    Stop()

    Declaration
    public void Stop()

    TryGetActorHandle<TState>(out ActorHandle)

    Gets the first matching actor handle for the actor state .

    Declaration
    public bool TryGetActorHandle<TState>(out ActorHandle handle)
        where TState : class
    Parameters
    Type Name Description
    ActorHandle handle
    Returns
    Type Description
    Boolean

    True if there is a match; otherwise, false.

    Type Parameters
    Name Description
    TState

    TryGetActorState<TState>(out TState)

    Gets the first matching actor for type and returns its internal state.

    Declaration
    public bool TryGetActorState<TState>(out TState state)
        where TState : class
    Parameters
    Type Name Description
    TState state
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TState
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023