Class Script
Base class for all scripts.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Scripting/Script.h
Syntax
public class Script : public SceneObject
Fields
_enabled
Declaration
protected uint16 _enabled
Field Value
uint16
|
_executeInEditor
Declaration
protected uint16 _executeInEditor
Field Value
uint16
|
_tickFixedUpdate
Declaration
protected uint16 _tickFixedUpdate
Field Value
uint16
|
_tickLateFixedUpdate
Declaration
protected uint16 _tickLateFixedUpdate
Field Value
uint16
|
_tickLateUpdate
Declaration
protected uint16 _tickLateUpdate
Field Value
uint16
|
_tickUpdate
Declaration
protected uint16 _tickUpdate
Field Value
uint16
|
_wasAwakeCalled
Declaration
protected uint16 _wasAwakeCalled
Field Value
uint16
|
_wasEnableCalled
Declaration
protected uint16 _wasEnableCalled
Field Value
uint16
|
_wasStartCalled
Declaration
protected uint16 _wasStartCalled
Field Value
uint16
|
Methods
BeginPlay(SceneBeginData* data)
Called when adding object to the game.
Declaration
public virtual void BeginPlay(SceneBeginData* data) override
Parameters
SceneBeginData
data
The initialization data (e.g. used to collect joints to link after begin). |
Overrides
Deserialize(DeserializeStream& stream, ISerializeModifier* modifier)
Deserializes object from the input stream.
Declaration
public virtual void Deserialize(DeserializeStream& stream, ISerializeModifier* modifier) override
Parameters
DeserializeStream
stream
The input stream. |
ISerializeModifier
modifier
The deserialization modifier object. Always valid. |
Overrides
EndPlay()
Called when removing object from the game.
Declaration
public virtual void EndPlay() override
Overrides
GetActor()
GetEnabled()
Gets value indicating if script is active.
Declaration
public bool GetEnabled() const
Returns
bool
|
GetOrderInParent()
Gets zero-based index in parent actor children list (scripts or child actors).
Declaration
public virtual int32 GetOrderInParent() const override
Returns
int32
The order in parent. |
Overrides
GetSceneObjectId()
Gets the scene object ID.
Declaration
public virtual Guid GetSceneObjectId() const override
Returns
Guid
The scene object ID. |
Overrides
Initialize()
Called after object loading or spawning to initialize the object (eg. call OnAwake for scripts) but before BeginPlay. Initialization should be performed only within a single SceneObject (use BeginPlay to initialize with a scene).
Declaration
public virtual void Initialize() override
Overrides
IsEnabledInHierarchy()
Gets value indicating if script is enabled and active in the scene graph. It must be active as well as all it's parents.
Declaration
public bool IsEnabledInHierarchy() const
Returns
bool
|
OnAwake()
Called after the object is loaded.
Declaration
public virtual void OnAwake()
OnDebugDraw()
Called during drawing debug shapes in editor. Use DebugDraw to draw debug shapes and other visualization.
Declaration
public virtual void OnDebugDraw()
OnDebugDrawSelected()
Called during drawing debug shapes in editor when object is selected. Use DebugDraw to draw debug shapes and other visualization.
Declaration
public virtual void OnDebugDrawSelected()
OnDeleteObject()
Deletes the object. Called by the ObjectsRemovalService. Can be overriden to provide custom logic per object (cleanup, etc.).
Declaration
public virtual void OnDeleteObject() override
Overrides
OnDestroy()
Called before the object will be destroyed.
Declaration
public virtual void OnDestroy()
OnDisable()
Called when object becomes disabled and inactive.
Declaration
public virtual void OnDisable()
OnEnable()
Called when object becomes enabled and active.
Declaration
public virtual void OnEnable()
OnFixedUpdate()
Called every fixed framerate frame if object is enabled.
Declaration
public virtual void OnFixedUpdate()
OnLateFixedUpdate()
Called every fixed framerate frame (after FixedUpdate) if object is enabled.
Declaration
public virtual void OnLateFixedUpdate()
OnLateUpdate()
Called every frame (after gameplay Update) if object is enabled.
Declaration
public virtual void OnLateUpdate()
OnStart()
Called when a script is enabled just before any of the Update methods is called for the first time.
Declaration
public virtual void OnStart()
OnUpdate()
Called every frame if object is enabled.
Declaration
public virtual void OnUpdate()
Serialize(SerializeStream& stream, const void* otherObj)
Serializes object to the output stream compared to the values of the other object instance (eg. default class object). If other object is null then serialize all properties.
Declaration
public virtual void Serialize(SerializeStream& stream, const void* otherObj) override
Parameters
SerializeStream
stream
The output stream. |
void
otherObj
The instance of the object to compare with and serialize only the modified properties. If null, then serialize all properties. |
Overrides
SetActor(Actor* value)
Sets the actor owning that script.
Declaration
public void SetActor(Actor* value)
Parameters
Actor
value
|
SetEnabled(bool value)
Sets enabled state if this script.
Declaration
public void SetEnabled(bool value)
Parameters
bool
value
|
SetOrderInParent(int32 index)
Sets zero-based index in parent actor children list (scripts or child actors).
Declaration
public virtual void SetOrderInParent(int32 index) override
Parameters
int32
index
The new order in parent. |
Overrides
SetParent(Actor* value, bool canBreakPrefabLink=true)
Sets the parent actor.
Declaration
public virtual void SetParent(Actor* value, bool canBreakPrefabLink=true) override
Parameters
Actor
value
The new parent. |
bool
canBreakPrefabLink
True if can break prefab link on changing the parent. |
Overrides
ToString()
Gets the string representation of this object.
Declaration
public virtual String ToString() const override
Returns
String
|