Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ScriptComponent Class

    Namespace: Stride.Engine
    Assembly: Stride.Engine.dll

    Script component.

    System.Object → EntityComponent → ScriptComponent
    Derived from ScriptComponent: AsyncScript StartupScript

    [DataContract("ScriptComponent", Inherited = true)]
    [DefaultEntityComponentProcessor(typeof(ScriptProcessor), ExecutionMode = ExecutionMode.Runtime)]
    [Display(null, null, Expand = ExpandRule.Once)]
    [ComponentOrder(1000)]
    [ComponentCategory("Scripts")]
    public abstract class ScriptComponent : EntityComponent, IIdentifiable, ICollectorHolder
    Name Description
    Constructors
    ScriptComponent()
    Fields
    LiveScriptingMask
    ScriptGlobalProfilingKey

    The global profiling key for scripts. Activate/deactivate this key to activate/deactivate profiling for all your scripts.

    Properties
    Audio
    Collector

    The object collector associated with this script.

    Content
    DebugText
    EffectSystem
    Game
    GameProfiler
    GraphicsDevice
    Input
    IsLiveReloading

    Determines whether the script is currently undergoing live reloading.

    Log
    Priority

    The priority this script will be scheduled with (compared to other scripts).

    ProfilingKey

    Gets the profiling key to activate/deactivate profiling for the current script class.

    SceneSystem
    Script
    Services
    SpriteAnimation
    Streaming

    Gets the streaming system.

    Methods
    Cancel()

    Called when the script's update loop is canceled.

    PriorityUpdated()

    Internal helper function called when Priority is changed.

    | Improve this Doc View Source

    Constructors


    ScriptComponent()

    protected ScriptComponent()
    | Improve this Doc View Source

    Fields


    LiveScriptingMask

    public const uint LiveScriptingMask = 128U
    Field Value
    Type Description
    System.UInt32

    ScriptGlobalProfilingKey

    The global profiling key for scripts. Activate/deactivate this key to activate/deactivate profiling for all your scripts.

    public static readonly ProfilingKey ScriptGlobalProfilingKey
    Field Value
    Type Description
    ProfilingKey
    | Improve this Doc View Source

    Properties


    Audio

    public AudioSystem Audio { get; }
    Property Value
    Type Description
    AudioSystem

    Collector

    The object collector associated with this script.

    public ObjectCollector Collector { get; }
    Property Value
    Type Description
    ObjectCollector

    Content

    public ContentManager Content { get; }
    Property Value
    Type Description
    ContentManager

    DebugText

    public DebugTextSystem DebugText { get; }
    Property Value
    Type Description
    DebugTextSystem

    EffectSystem

    public EffectSystem EffectSystem { get; }
    Property Value
    Type Description
    EffectSystem

    Game

    public IGame Game { get; }
    Property Value
    Type Description
    IGame

    GameProfiler

    public GameProfilingSystem GameProfiler { get; }
    Property Value
    Type Description
    GameProfilingSystem

    GraphicsDevice

    public GraphicsDevice GraphicsDevice { get; }
    Property Value
    Type Description
    GraphicsDevice

    Input

    public InputManager Input { get; }
    Property Value
    Type Description
    InputManager

    IsLiveReloading

    Determines whether the script is currently undergoing live reloading.

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

    Log

    protected Logger Log { get; }
    Property Value
    Type Description
    Logger

    Priority

    The priority this script will be scheduled with (compared to other scripts).

    [DataMember(10000)]
    public int Priority { get; set; }
    Property Value
    Type Description
    System.Int32

    ProfilingKey

    Gets the profiling key to activate/deactivate profiling for the current script class.

    public ProfilingKey ProfilingKey { get; }
    Property Value
    Type Description
    ProfilingKey

    SceneSystem

    public SceneSystem SceneSystem { get; }
    Property Value
    Type Description
    SceneSystem

    Script

    public ScriptSystem Script { get; }
    Property Value
    Type Description
    ScriptSystem

    Services

    public IServiceRegistry Services { get; }
    Property Value
    Type Description
    IServiceRegistry

    SpriteAnimation

    public SpriteAnimationSystem SpriteAnimation { get; }
    Property Value
    Type Description
    SpriteAnimationSystem

    Streaming

    Gets the streaming system.

    public StreamingManager Streaming { get; }
    Property Value
    Type Description
    StreamingManager

    The streaming system.

    | Improve this Doc View Source

    Methods


    Cancel()

    Called when the script's update loop is canceled.

    public virtual void Cancel()

    PriorityUpdated()

    Internal helper function called when Priority is changed.

    protected virtual void PriorityUpdated()

    Inherited Members

    EntityComponent.Entity
    EntityComponent.Id
    EntityComponent.EnsureEntity

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    PhysicsScriptComponentExtensions.GetSimulation(ScriptComponent)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation