-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.h
More file actions
75 lines (57 loc) · 981 Bytes
/
Component.h
File metadata and controls
75 lines (57 loc) · 981 Bytes
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
#ifndef __Component_H__
#define __Component_H__
#include "Globals.h"
#include "Imgui/imgui.h"
#include "Imgui/imgui_impl_sdl.h"
#include "Imgui/imgui_impl_opengl3.h"
#include <string>
enum ComponentType
{
TRANSFORM = 0,
MESH,
MATERIAL,
CAMERA,
LIGHT
};
class GameObject;
class SceneLoader;
class Component
{
public:
Component()
{
}
Component(const char* componentName)
{
name = componentName;
}
virtual void Enable()
{
return;
}
virtual void Disable()
{
return;
}
virtual void Update()
{
return;
}
virtual bool CleanUp()
{
return true;
}
virtual void OnSave(SceneLoader & loader) {}
virtual void OnLoad(SceneLoader & loader) {}
virtual void DrawInspector()
{
return;
}
//GameObject Parent:
//IMPORTANT, THIS POINTER MUST BE SYNC WITH PARENTS CHILDREN, BE CAREFUL
GameObject* myGameObject = nullptr;
ComponentType myType = TRANSFORM;
bool isActive = true;
std::string name = "NewComponent";
};
#endif __Component_H__