KS.Reactor.ksScript< Parent, Script > Class Template Reference

Base class for Reactor scripts. More...

Inheritance diagram for KS.Reactor.ksScript< Parent, Script >:

Classes

interface  IInternals
 Internal interface. More...
 

Public Member Functions

virtual void Attached ()
 Called immediately when the script is attached. More...
 
virtual void Initialize ()
 Called after all other scripts on all entities are attached. More...
 
virtual void Detached ()
 Called when the script is detached. More...
 
virtual Script Clone ()
 Creates a copy of the script with the value of all members tagged with ksEditable or ksCloneable copied. More...
 

Properties

Type InstanceType [get]
 Gets the most derived type of this script. More...
 
bool IsAttached [get, set]
 Is the script attached? More...
 
ksScriptList< Parent, Script > Scripts [get, set]
 List this script is in. More...
 
ksBaseAssetLoader Assets [get]
 Asset loader. More...
 

Detailed Description

Base class for Reactor scripts.

Template Parameters
ParentType the script can be attached to.
ScriptType of script this is.
Type Constraints
Parent :class 
Script :ksScript 
Script :Parent 
Script :Script 

Member Function Documentation

◆ Attached()

virtual void KS.Reactor.ksScript< Parent, Script >.Attached ( )
virtual

Called immediately when the script is attached.

Other scripts may not be attached or have their ksEditable field loaded yet, so it is not safe to access other scripts. Initialization that depends on other scripts should be done from Initialize. Attached is called on each script in the order they were configured.

Reimplemented in KS.Reactor.Server.ksShapeCollider, KS.Reactor.Server.ksRigidBody2DView, KS.Reactor.Server.ksRigidBody, KS.Reactor.Server.ksCharacterController, and KS.Reactor.Server.ksBaseRigidBody.

◆ Clone()

virtual Script KS.Reactor.ksScript< Parent, Script >.Clone ( )
virtual

Creates a copy of the script with the value of all members tagged with ksEditable or ksCloneable copied.

Arrays, lists, and dictionaries are cloned. Other object references will reference the same object.

Returns
Cloned script.

Reimplemented in KS.Reactor.Server.ksShapeCollider, KS.Reactor.Server.ksPlaneCollider, KS.Reactor.Server.ksCollider, KS.Reactor.Server.ksCapsuleCollider, KS.Reactor.Server.ksBoxCollider, and KS.Reactor.Server.ksBaseRigidBody.

◆ Detached()

virtual void KS.Reactor.ksScript< Parent, Script >.Detached ( )
virtual

Called when the script is detached.

Remove event listeners and perform other clean up logic here.

Reimplemented in KS.Reactor.Server.ksShapeCollider, KS.Reactor.Server.ksRigidBody2DView, KS.Reactor.Server.ksRigidBody, KS.Reactor.Server.ksJoint, KS.Reactor.Server.ksCharacterController, and KS.Reactor.Server.ksBaseRigidBody.

◆ Initialize()

virtual void KS.Reactor.ksScript< Parent, Script >.Initialize ( )
virtual

Called after all other scripts on all entities are attached.

Initialize is called on each script in the order they were configured.

Reimplemented in KS.Reactor.Server.ksJoint.

Property Documentation

◆ Assets

ksBaseAssetLoader KS.Reactor.ksScript< Parent, Script >.Assets
get

Asset loader.

◆ InstanceType

Type KS.Reactor.ksScript< Parent, Script >.InstanceType
get

Gets the most derived type of this script.

◆ IsAttached

bool KS.Reactor.ksScript< Parent, Script >.IsAttached
getset

Is the script attached?

◆ Scripts

ksScriptList<Parent, Script> KS.Reactor.ksScript< Parent, Script >.Scripts
getset

List this script is in.