109 lines
3.8 KiB
C++
109 lines
3.8 KiB
C++
#pragma once
|
|
|
|
#include "Engine/Scripting/Script.h"
|
|
#include <Engine/Animations/Curve.h>
|
|
#include <Engine/AI/Behavior.h>
|
|
|
|
#include "Engine/Graphics/PostProcessEffect.h"
|
|
#include "Engine/Graphics/RenderTask.h"
|
|
#include "Engine/Graphics/Graphics.h"
|
|
#include "Engine/Scripting/SoftTypeReference.h"
|
|
#include "Engine/Content/SceneReference.h"
|
|
|
|
API_ENUM() enum TestTypeEnum
|
|
{
|
|
None,
|
|
Value1,
|
|
Value22,
|
|
};
|
|
|
|
/*template<typename T>
|
|
API_STRUCT() struct GAME_API MyThinger
|
|
{
|
|
public:
|
|
T fieldo;
|
|
};*/
|
|
|
|
API_STRUCT(NoDefault) struct TestStruct : public ISerializable
|
|
{
|
|
API_AUTO_SERIALIZATION();
|
|
DECLARE_SCRIPTING_TYPE_MINIMAL(TestStruct);
|
|
|
|
// Var
|
|
API_FIELD() Float3 Vector = Float3::One;
|
|
// Ref
|
|
API_FIELD() ScriptingObject* Object = nullptr;
|
|
// Soft Type Ref
|
|
API_FIELD() SoftTypeReference<ScriptingObject> SoftTypeRef;
|
|
// Scene Ref
|
|
API_FIELD() SceneReference SceneRef;
|
|
|
|
friend bool operator==(const TestStruct& lhs, const TestStruct& rhs)
|
|
{
|
|
return lhs.Vector == rhs.Vector &&
|
|
lhs.Object == rhs.Object &&
|
|
lhs.SoftTypeRef == rhs.SoftTypeRef &&
|
|
lhs.SceneRef == rhs.SceneRef;
|
|
}
|
|
};
|
|
|
|
API_CLASS() class GAME_API MyScript2 : public Script
|
|
{
|
|
API_AUTO_SERIALIZATION();
|
|
DECLARE_SCRIPTING_TYPE(MyScript2);
|
|
|
|
API_FUNCTION() virtual void SimpleCall() {};
|
|
API_FUNCTION() virtual void SimpleParams(int a, float b, char c, double d, long e) {};
|
|
API_FUNCTION() virtual void StringParamAnsi(StringAnsi str) {};
|
|
API_FUNCTION() virtual void StringParam(String str) {};
|
|
API_FUNCTION() virtual void StringParamRef(String& str) {};
|
|
API_FUNCTION() virtual void StringParamRefConst(const String& str) {};
|
|
API_FUNCTION() virtual void StringParamAsRef(API_PARAM(Ref) String& str) {};
|
|
API_FUNCTION() virtual void ActorParam(Actor* actor) {};
|
|
API_FUNCTION() virtual void ComplexParam(BehaviorUpdateContext context) {};
|
|
API_FUNCTION() virtual void Complex2Param(RenderContext& context) {};
|
|
API_FUNCTION() virtual void Complex2ParamConst(const RenderContext& context) {};
|
|
API_FUNCTION() virtual void Complex2ParamAsRef(API_PARAM(Ref) RenderContext& context) {};
|
|
API_FUNCTION() virtual void SimpleArrayParam(Array<int> arr) {};
|
|
API_FUNCTION() virtual void SimpleArrayParamRef(Array<int>& arr) {};
|
|
API_FUNCTION() virtual void SimpleArrayParamRefConst(const Array<int>& arr) {};
|
|
API_FUNCTION() virtual void SimpleArrayParamAsRef(API_PARAM(Ref) Array<int>& arr) {};
|
|
API_FUNCTION() virtual void ActorArrayParam(Array<Actor*> arr) {};
|
|
API_FUNCTION() virtual void ActorArrayParamRef(Array<Actor*>& arr) {};
|
|
API_FUNCTION() virtual void ActorArrayParamRefConst(const Array<Actor*>& arr) {};
|
|
//API_FUNCTION() virtual void ActorArrayParamAsRef(API_PARAM(Ref) Array<Actor*>& arr) {};
|
|
API_FUNCTION() virtual void ComplexArrayParam(Array<TestStruct> arr) {};
|
|
API_FUNCTION() virtual void ComplexArrayParamRef(Array<TestStruct>& arr) {};
|
|
API_FUNCTION() virtual void ComplexArrayParamRefConst(const Array<TestStruct>& arr) {};
|
|
API_FUNCTION() virtual void ComplexArrayParamAsRef(API_PARAM(Ref) Array<TestStruct>& arr) {};
|
|
|
|
|
|
//API_EVENT() Delegate<int32, Float3, const String&, String&, TestStruct&, const Array<TestStruct>&, Array<TestStruct>&> TestEvent;
|
|
|
|
};
|
|
|
|
API_CLASS() class GAME_API MyScript : public Script
|
|
{
|
|
API_AUTO_SERIALIZATION();
|
|
DECLARE_SCRIPTING_TYPE(MyScript);
|
|
|
|
/*API_STRUCT() struct GAME_API InnerStructer
|
|
{
|
|
public:
|
|
float floaty;
|
|
};*/
|
|
|
|
//API_FIELD() MyThinger<int> thingey;
|
|
|
|
// [Script]
|
|
void OnStart() override;
|
|
void OnEnable() override;
|
|
void OnDisable() override;
|
|
void OnUpdate() override;
|
|
|
|
|
|
|
|
//API_FUNCTION() void Test1(API_PARAM(REF) Array<TestTypeEnum>& eenums) {};
|
|
//API_FUNCTION() BezierCurve<Transform>.Keyframe Test2(BezierCurve<Transform> kef) {};
|
|
};
|