Search Results for

    Show / Hide Table of Contents

    Class Ability

    Represents an ability in the ability system. Allows multiple instances to be defined. Can be customized via AbilityData inspector.

    Inheritance
    object
    Object
    ScriptableObject
    Ability
    AbilityCoroutine
    OffhandAbility
    WeaponArt
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: LobsterFramework.AbilitySystem
    Assembly: LobsterFramework.dll
    Syntax
    public abstract class Ability : ScriptableObject

    Fields

    | Improve this Doc View Source

    DefaultAbilityInstance

    Declaration
    public const string DefaultAbilityInstance = "default"
    Field Value
    Type Description
    string

    Properties

    | Improve this Doc View Source

    AbilityManager

    Declaration
    protected AbilityManager AbilityManager { get; }
    Property Value
    Type Description
    AbilityManager
    | Improve this Doc View Source

    Channel

    The communication channel with client code of the currently executing ability instance

    Declaration
    protected AbilityChannel Channel { get; }
    Property Value
    Type Description
    AbilityChannel
    | Improve this Doc View Source

    Config

    The configuration of the currently executing ability instance

    Declaration
    protected AbilityConfig Config { get; }
    Property Value
    Type Description
    AbilityConfig
    | Improve this Doc View Source

    Context

    The runtime context object of the currently executing ability instance

    Declaration
    protected AbilityContext Context { get; }
    Property Value
    Type Description
    AbilityContext
    | Improve this Doc View Source

    ExecutionPriority

    The priority in which this ability will be executed. Higher number means earlier execution in relation to other abilities.

    Declaration
    public int ExecutionPriority { get; }
    Property Value
    Type Description
    int
    | Improve this Doc View Source

    Instance

    The name of the currently running ability instance

    Declaration
    protected string Instance { get; }
    Property Value
    Type Description
    string

    Methods

    | Improve this Doc View Source

    Action()

    Called every frame while the ability instance remains in the execution queue.

    Declaration
    protected abstract bool Action()
    Returns
    Type Description
    bool

    false if the ability has finished and should not execute further, otherwise true

    | Improve this Doc View Source

    ConditionSatisfied()

    Used for doing additional requirement check for running the ability.

    Declaration
    protected virtual bool ConditionSatisfied()
    Returns
    Type Description
    bool

    true if the condition for this ability has been satisfied, otherwise false

    | Improve this Doc View Source

    FinalizeContext()

    Called to finialize the ability context and channels

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

    FinalizeSharedReferences()

    Called to finialize the references shared by all ability instances

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

    GetAbilityComponent<T>()

    Attempts to get the reference of the specified AbilityComponent stored in the same AbilityData

    Declaration
    protected T GetAbilityComponent<T>() where T : AbilityComponent
    Returns
    Type Description
    T

    The reference to the AbilityComponent if exists

    Type Parameters
    Name Description
    T

    The type of the AbilityComponent being asked for

    Remarks

    This is a shorthand call for GetAbilityComponent<T>() via AbilityManager

    | Improve this Doc View Source

    GetComponentReference<T>(int)

    Attempts to get the reference of the specified component type from AbilityManager. The type of the reference should be one of the required types applied via RequireComponentReferenceAttribute on this ability class.

    Declaration
    protected T GetComponentReference<T>(int index = 0) where T : Component
    Parameters
    Type Name Description
    int index

    The index to the list of components of the type specified. Use of type safe enum is strongly recommended.

    Returns
    Type Description
    T

    The component reference stored in AbilityManager if it exists, otherwise null

    Type Parameters
    Name Description
    T

    The type of the component looking for

    Remarks

    This is a shorthand call for GetComponentReference<T>(Type, int) via AbilityManager

    | Improve this Doc View Source

    HasInstance(string)

    Check if the ability has specified configuration

    Declaration
    public bool HasInstance(string instance)
    Parameters
    Type Name Description
    string instance

    Name of the ability instance being queried

    Returns
    Type Description
    bool

    true if exists, false otherwise

    | Improve this Doc View Source

    InitializeContext()

    Called to initialize ability context and channels

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

    InitializeSharedReferences()

    Called to initialize the references shared by all ability instances

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

    IsReady(string)

    Check if the speficied ability instance is ready

    Declaration
    public bool IsReady(string instance)
    Parameters
    Type Name Description
    string instance

    The name of the instance of the ability instance

    Returns
    Type Description
    bool

    true if config with specified name exists and is ready, false otherwise

    | Improve this Doc View Source

    IsRunning(string)

    Check if the ability instance is executing, this method will return false if the instance is not present

    Declaration
    public bool IsRunning(string instance)
    Parameters
    Type Name Description
    string instance

    The name of the instance to be examined

    Returns
    Type Description
    bool

    true if the specified instance is executing, otherwise false

    | Improve this Doc View Source

    JoinAsSecondary(Type, string)

    Attempt to join the current running ability with another ability that is running. On success, the current running ability will terminate no later than the joined ability.

    Declaration
    protected bool JoinAsSecondary(Type abilityType, string instance)
    Parameters
    Type Name Description
    Type abilityType

    The type of the ability to be joined with

    string instance

    The name of the instance of the ability to be joined

    Returns
    Type Description
    bool

    Return true on success, otherwise false

    | Improve this Doc View Source

    JoinAsSecondary<T>(string)

    Attempt to join the current running ability with another ability that is running. On success, the current running ability will terminate no later than the joined ability.

    Declaration
    protected bool JoinAsSecondary<T>(string instance) where T : Ability
    Parameters
    Type Name Description
    string instance

    The name of the instance of the running ability to be joined

    Returns
    Type Description
    bool

    Return true on success, otherwise false

    Type Parameters
    Name Description
    T

    The type of the ability to be joined with

    | Improve this Doc View Source

    OnAbilityEnqueue()

    Called when the ability is added to the queue for execution

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

    OnAbilityFinish()

    Called when the ability is finished or halted.

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

    OnAnimationInterrupt(AnimancerState)

    Called when the animation of the ability is interrupted by other abilities. Useful when abilities relies on animation events. Default implementation suspends the ability.

    Declaration
    protected virtual void OnAnimationInterrupt(AnimancerState state)
    Parameters
    Type Name Description
    AnimancerState state
    | Improve this Doc View Source

    OnSignaled()

    Signal handler for user event.

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

    OnSignaled(AnimationEvent)

    Signal handler for animation event.

    Declaration
    protected virtual void OnSignaled(AnimationEvent animationEvent)
    Parameters
    Type Name Description
    AnimationEvent animationEvent
    | Improve this Doc View Source

    StartAnimation(AnimationClip, float)

    Declaration
    protected AnimancerState StartAnimation(AnimationClip animation, float speed = 1)
    Parameters
    Type Name Description
    AnimationClip animation
    float speed
    Returns
    Type Description
    AnimancerState
    | Improve this Doc View Source

    SuspendAll()

    Suspend the execution of all running instances of this ability

    Declaration
    protected void SuspendAll()
    | Improve this Doc View Source

    SuspendInstance(string)

    Suspend the execution of the specified ability instance and causing it to finish during the next suspension event.

    Declaration
    protected bool SuspendInstance(string instance)
    Parameters
    Type Name Description
    string instance

    Name of the configuration of the ability instance to terminate

    Returns
    Type Description
    bool

    true if the configuration exists and is not running or suspended, otherwise false

    • Improve this Doc
    • View Source
    In This Article
    Back to top LobsterFramework documentation