Add more scripting templates.

This commit is contained in:
Chandler Cox
2024-11-22 17:07:10 -06:00
parent d4b663cd1a
commit 0335086df8
9 changed files with 204 additions and 3 deletions

View File

@@ -0,0 +1,19 @@
%copyright%#include "%filename%.h"
%class%::%class%(const SpawnParams& params)
: Actor(params)
{
}
void %class%::OnEnable()
{
Actor::OnEnable();
// Here you can add code that needs to be called when script is enabled (eg. register for events)
}
void %class%::OnDisable()
{
Actor::OnDisable();
// Here you can add code that needs to be called when script is disabled (eg. unregister from events)
}

View File

@@ -0,0 +1,39 @@
%copyright%using System;
using System.Collections.Generic;
using FlaxEngine;
namespace %namespace%;
/// <summary>
/// %class% Actor.
/// </summary>
public class %class% : Actor
{
/// <inheritdoc/>
public override void OnBeginPlay()
{
base.OnBeginPlay();
// Here you can add code that needs to be called when Actor added to the game. This is called during edit time as well.
}
/// <inheritdoc/>
public override void OnEndPlay()
{
base.OnEndPlay();
// Here you can add code that needs to be called when Actor removed to the game. This is called during edit time as well.
}
/// <inheritdoc/>
public override void OnEnable()
{
base.OnEnable();
// Here you can add code that needs to be called when Actor is enabled (eg. register for events). This is called during edit time as well.
}
/// <inheritdoc/>
public override void OnDisable()
{
base.OnDisable();
// Here you can add code that needs to be called when Actor is disabled (eg. unregister from events). This is called during edit time as well.
}
}

View File

@@ -0,0 +1,13 @@
%copyright%#pragma once
#include "Engine/Level/Actor.h"
API_CLASS() class %module%%class% : public Actor
{
API_AUTO_SERIALIZATION();
DECLARE_SCENE_OBJECT(%class%);
// [Actor]
void OnEnable() override;
void OnDisable() override;
};

View File

@@ -0,0 +1,13 @@
%copyright%using System;
using System.Collections.Generic;
using FlaxEngine;
namespace %namespace%;
/// <summary>
/// %class% class.
/// </summary>
public class %class%
{
}

View File

@@ -0,0 +1,13 @@
%copyright%using System;
using System.Collections.Generic;
using FlaxEngine;
namespace %namespace%;
/// <summary>
/// %class% interface.
/// </summary>
public interface %class%
{
}

View File

@@ -0,0 +1,13 @@
%copyright%using System;
using System.Collections.Generic;
using FlaxEngine;
namespace %namespace%;
/// <summary>
/// %class% struct.
/// </summary>
public struct %class%
{
}