NWengine 0.9
|
The base class for script components. More...
#include <Script.h>
Public Member Functions | |
Script (GameObject *attachedObj) | |
Constructs a Script object. | |
void | Start () override |
Called when the script is started. | |
void | Update () override |
Called every frame to update the script. | |
template<typename T > | |
void | SetScript () |
Sets the script to the specified type. | |
int | Serialize (std::fstream *data, int offset) override |
Serializes the script data. | |
int | Deserialize (std::fstream *data, int offset) override |
Deserializes the script data. | |
Public Member Functions inherited from GameComponent | |
virtual void | SetGameObject (void *go) |
Set the GameObject associated with the game component. | |
virtual void * | GetGameObject () |
Get the GameObject associated with the game component. | |
virtual | ~GameComponent () |
Destructor for the game component. | |
Public Member Functions inherited from Serialized | |
Serialized () | |
Default constructor for Serialized class. | |
Static Public Member Functions | |
static std::string | GetType () |
Gets the type of the script component. | |
Static Public Member Functions inherited from GameComponent | |
static std::string | GetType () |
Get the type of the game component. | |
Public Attributes | |
GameObject * | attachedObj = nullptr |
Scriptable * | script = nullptr |
Static Public Attributes | |
static std::map< GameObject *, Script > | componentList |
The base class for script components.
Represents a script component that can be attached to a game object.
Script::Script | ( | GameObject * | attachedObj | ) |
Constructs a Script object.
Default constructor.
attachedObj | The GameObject to attach the script to. |
Deserializes the script data.
data | The file stream to read the data from. |
offset | The offset in the file stream. |
Reimplemented from Serialized.
|
inlinestatic |
Gets the type of the script component.
Serializes the script data.
data | The file stream to write the data to. |
offset | The offset in the file stream. |
Reimplemented from Serialized.
Sets the script to the specified type.
T | The type of the script. |
|
overridevirtual |
Called when the script is started.
Reimplemented from GameComponent.
|
overridevirtual |
Called every frame to update the script.
Reimplemented from GameComponent.
GameObject* Script::attachedObj = nullptr |
The attached GameObject.
|
static |
The list of script components.
Scriptable* Script::script = nullptr |
The script object.