Character controller working better
Moved ECS systems to separate folders better raycast normal result
This commit is contained in:
18
Nuake/src/Scene/Components/NativeScriptComponent.h
Normal file
18
Nuake/src/Scene/Components/NativeScriptComponent.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#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; };
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user