This repository was archived by the owner on Jan 18, 2024. It is now read-only.
forked from rpbpolis/spic-prj-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBehaviourScript.hpp
84 lines (70 loc) · 2.21 KB
/
BehaviourScript.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef BEHAVIOURSCRIPT_H_
#define BEHAVIOURSCRIPT_H_
#include "Component.hpp"
#include "Collider.hpp"
#if __has_include("BehaviourScript_includes.hpp")
#include "BehaviourScript_includes.hpp"
#endif
namespace spic {
/**
* @brief Base class for script running in the game.
*/
class BehaviourScript : public Component {
public:
/**
* @brief constructor for BehaviourScript
* @sharedapi
*/
BehaviourScript();
/**
* @brief TODO
* @spicapi
*/
virtual void OnStart();
/**
* @brief TODO
* @spicapi
*/
virtual void OnUpdate();
/**
* @brief Triggers after all Update functions have been called.
* @sharedapi
*/
virtual void OnLateUpdate() { }
/**
* @brief Sent when another object enters a trigger collider
* attached to this object (2D physics only).
* @spicapi
*/
virtual void OnTriggerEnter2D(const Collider& collider);
/**
* @brief Sent when another object leaves a trigger collider
* attached to this object (2D physics only).
* @spicapi
*/
virtual void OnTriggerExit2D(const Collider& collider);
/**
* @brief Sent each frame where another object is within a trigger
* collider attached to this object (2D physics only).
* @spicapi
*/
virtual void OnTriggerStay2D(const Collider& collider);
/**
* @brief Whether the script has been started.
* @param started desired value
* @sharedapi
*/
void Started(bool started);
/**
* @brief Whether the script has been started.
* @return current value
* @sharedapi
*/
bool Started() const;
private:
#if __has_include("BehaviourScript_private.hpp")
#include "BehaviourScript_private.hpp"
#endif
};
}
#endif // BEHAVIOURSCRIPT_H_