Major cleanup.
Moved to namespace Cleanup includes
This commit is contained in:
@@ -2,17 +2,18 @@
|
||||
#include <functional>
|
||||
#include "../Core/Timestep.h"
|
||||
#include "../Entities/ScriptableEntity.h"
|
||||
|
||||
struct NativeScriptComponent
|
||||
{
|
||||
ScriptableEntity* Instance = nullptr;
|
||||
|
||||
ScriptableEntity *(*InstantiateScript)();
|
||||
void (*DestroyScript)(NativeScriptComponent*);
|
||||
|
||||
template<typename T>
|
||||
void Bind()
|
||||
{
|
||||
InstantiateScript = []() { return static_cast<ScriptableEntity*>(new T()); };
|
||||
DestroyScript = [](NativeScriptComponent* nsc) { delete nsc->Instance; nsc->Instance = nullptr; };
|
||||
}
|
||||
//ScriptableEntity* Instance = nullptr;
|
||||
//
|
||||
//ScriptableEntity *(*InstantiateScript)();
|
||||
//void (*DestroyScript)(NativeScriptComponent*);
|
||||
//
|
||||
//template<typename T>
|
||||
//void Bind()
|
||||
//{
|
||||
// InstantiateScript = []() { return static_cast<ScriptableEntity*>(new T()); };
|
||||
// DestroyScript = [](NativeScriptComponent* nsc) { delete nsc->Instance; nsc->Instance = nullptr; };
|
||||
//}
|
||||
};
|
||||
Reference in New Issue
Block a user