Represents a user-defined script that can be attached to game objects.
More...
#include <UserScript.hpp>
|
| | UserScript (std::string ScriptName) |
| | Constructs a new UserScript with the given name.
|
| | ~UserScript ()=default |
| | Default destructor.
|
| void | OnStart () override |
| | Called once when the script starts. Override this to initialize state or references needed by the script.
|
| void | Update (float deltatime) override |
| | Called every frame to update the script logic.
|
| void | SetName (const std::string &newName) |
| | Sets the name of the script.
|
| const std::string & | GetName () const |
| | Gets the name of the script.
|
| virtual | ~Script ()=default |
| | Virtual destructor. Ensures derived scripts are properly destroyed when deleted via a base pointer.
|
|
| std::string | name |
| | The name of the script.
|
Represents a user-defined script that can be attached to game objects.
Inherits from the abstract base class Script. Provides a name and implements the OnStart and Update lifecycle methods, which are called by the ScriptManager.
◆ UserScript()
| UserScript::UserScript |
( |
std::string | ScriptName | ) |
|
Constructs a new UserScript with the given name.
- Parameters
-
| ScriptName | The name to assign to this script. |
◆ ~UserScript()
| UserScript::~UserScript |
( |
| ) |
|
|
default |
◆ GetName()
| const std::string & UserScript::GetName |
( |
| ) |
const |
|
inline |
Gets the name of the script.
- Returns
- const std::string& The current name of the script.
◆ OnStart()
| void UserScript::OnStart |
( |
| ) |
|
|
overridevirtual |
Called once when the script starts. Override this to initialize state or references needed by the script.
Implements Script.
◆ SetName()
| void UserScript::SetName |
( |
const std::string & | newName | ) |
|
|
inline |
Sets the name of the script.
- Parameters
-
| newName | New name to assign. |
◆ Update()
| void UserScript::Update |
( |
float | deltatime | ) |
|
|
overridevirtual |
Called every frame to update the script logic.
- Parameters
-
| deltatime | Time elapsed since the last frame, in seconds. |
Implements Script.
◆ name
| std::string UserScript::name |
|
protected |
The documentation for this class was generated from the following file: