You're breathtaking!
This commit is contained in:
24
Content/Editor/Scripting/ScriptTemplate.cpp
Normal file
24
Content/Editor/Scripting/ScriptTemplate.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
%copyright%
|
||||
#include "%filename%.h"
|
||||
|
||||
%class%::%class%(const SpawnParams& params)
|
||||
: Script(params)
|
||||
{
|
||||
// Enable ticking OnUpdate function
|
||||
_tickUpdate = true;
|
||||
}
|
||||
|
||||
void %class%::OnEnable()
|
||||
{
|
||||
// Here you can add code that needs to be called when script is enabled (eg. register for events)
|
||||
}
|
||||
|
||||
void %class%::OnDisable()
|
||||
{
|
||||
// Here you can add code that needs to be called when script is disabled (eg. unregister from events)
|
||||
}
|
||||
|
||||
void %class%::OnUpdate()
|
||||
{
|
||||
// Here you can add code that needs to be called every frame
|
||||
}
|
||||
29
Content/Editor/Scripting/ScriptTemplate.cs
Normal file
29
Content/Editor/Scripting/ScriptTemplate.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
%copyright%using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace %namespace%
|
||||
{
|
||||
public class %class% : Script
|
||||
{
|
||||
public override void OnStart()
|
||||
{
|
||||
// Here you can add code that needs to be called when script is created, just before the first game update
|
||||
}
|
||||
|
||||
public override void OnEnable()
|
||||
{
|
||||
// Here you can add code that needs to be called when script is enabled (eg. register for events)
|
||||
}
|
||||
|
||||
public override void OnDisable()
|
||||
{
|
||||
// Here you can add code that needs to be called when script is disabled (eg. unregister from events)
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
// Here you can add code that needs to be called every frame
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Content/Editor/Scripting/ScriptTemplate.h
Normal file
14
Content/Editor/Scripting/ScriptTemplate.h
Normal file
@@ -0,0 +1,14 @@
|
||||
%copyright%
|
||||
#pragma once
|
||||
|
||||
#include "Engine/Scripting/Script.h"
|
||||
|
||||
API_CLASS() class %module%%class% : public Script
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE(%class%);
|
||||
|
||||
// [Script]
|
||||
void OnEnable() override;
|
||||
void OnDisable() override;
|
||||
void OnUpdate() override;
|
||||
};
|
||||
12
Content/Editor/Scripting/ShaderTemplate.shader
Normal file
12
Content/Editor/Scripting/ShaderTemplate.shader
Normal file
@@ -0,0 +1,12 @@
|
||||
%copyright%#include "./Flax/Common.hlsl"
|
||||
|
||||
META_CB_BEGIN(0, Data)
|
||||
float4 Color;
|
||||
META_CB_END
|
||||
|
||||
META_PS(true, FEATURE_LEVEL_ES2)
|
||||
float4 PS_Fullscreen(Quad_VS2PS input) : SV_Target
|
||||
{
|
||||
// Solid color fill from the constant buffer passed from code
|
||||
return Color;
|
||||
}
|
||||
Reference in New Issue
Block a user