Merge branch 'Tryibion-more-scripting-templates'
This commit is contained in:
19
Content/Editor/Scripting/ActorTemplate.cpp
Normal file
19
Content/Editor/Scripting/ActorTemplate.cpp
Normal 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)
|
||||
}
|
||||
39
Content/Editor/Scripting/ActorTemplate.cs
Normal file
39
Content/Editor/Scripting/ActorTemplate.cs
Normal 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.
|
||||
}
|
||||
}
|
||||
13
Content/Editor/Scripting/ActorTemplate.h
Normal file
13
Content/Editor/Scripting/ActorTemplate.h
Normal 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;
|
||||
};
|
||||
13
Content/Editor/Scripting/EmptyClassTemplate.cs
Normal file
13
Content/Editor/Scripting/EmptyClassTemplate.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
%copyright%using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace %namespace%;
|
||||
|
||||
/// <summary>
|
||||
/// %class% class.
|
||||
/// </summary>
|
||||
public class %class%
|
||||
{
|
||||
|
||||
}
|
||||
13
Content/Editor/Scripting/EmptyInterfaceTemplate.cs
Normal file
13
Content/Editor/Scripting/EmptyInterfaceTemplate.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
%copyright%using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace %namespace%;
|
||||
|
||||
/// <summary>
|
||||
/// %class% interface.
|
||||
/// </summary>
|
||||
public interface %class%
|
||||
{
|
||||
|
||||
}
|
||||
13
Content/Editor/Scripting/EmptyStructTemplate.cs
Normal file
13
Content/Editor/Scripting/EmptyStructTemplate.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
%copyright%using System;
|
||||
using System.Collections.Generic;
|
||||
using FlaxEngine;
|
||||
|
||||
namespace %namespace%;
|
||||
|
||||
/// <summary>
|
||||
/// %class% struct.
|
||||
/// </summary>
|
||||
public struct %class%
|
||||
{
|
||||
|
||||
}
|
||||
@@ -73,7 +73,7 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for C# script files.
|
||||
/// Context proxy object for C# Script files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CSharpProxy" />
|
||||
[ContentContextMenu("New/C#/C# Script")]
|
||||
@@ -89,6 +89,23 @@ namespace FlaxEditor.Content
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for C# Actor files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CSharpProxy" />
|
||||
[ContentContextMenu("New/C#/C# Actor")]
|
||||
public class CSharpActorProxy : CSharpProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Name => "C# Actor";
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void GetTemplatePath(out string path)
|
||||
{
|
||||
path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/ActorTemplate.cs");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for empty C# files.
|
||||
/// </summary>
|
||||
@@ -105,4 +122,55 @@ namespace FlaxEditor.Content
|
||||
path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/CSharpEmptyTemplate.cs");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for empty C# class files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CSharpProxy" />
|
||||
[ContentContextMenu("New/C#/C# Class")]
|
||||
public class CSharpEmptyClassProxy : CSharpProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Name => "C# Class";
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void GetTemplatePath(out string path)
|
||||
{
|
||||
path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/EmptyClassTemplate.cs");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for empty C# struct files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CSharpProxy" />
|
||||
[ContentContextMenu("New/C#/C# Struct")]
|
||||
public class CSharpEmptyStructProxy : CSharpProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Name => "C# Struct";
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void GetTemplatePath(out string path)
|
||||
{
|
||||
path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/EmptyStructTemplate.cs");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for empty C# interface files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CSharpProxy" />
|
||||
[ContentContextMenu("New/C#/C# Interface")]
|
||||
public class CSharpEmptyInterfaceProxy : CSharpProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Name => "C# Interface";
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void GetTemplatePath(out string path)
|
||||
{
|
||||
path = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/EmptyInterfaceTemplate.cs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,24 @@ namespace FlaxEditor.Content
|
||||
sourceTemplate = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/ScriptTemplate.cpp");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for C++ Actor files.
|
||||
/// </summary>
|
||||
/// <seealso cref="FlaxEditor.Content.CppProxy" />
|
||||
[ContentContextMenu("New/C++/C++ Actor")]
|
||||
public class CppActorProxy : CppProxy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override string Name => "C++ Actor";
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void GetTemplatePaths(out string headerTemplate, out string sourceTemplate)
|
||||
{
|
||||
headerTemplate = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/ActorTemplate.h");
|
||||
sourceTemplate = StringUtils.CombinePaths(Globals.EngineContentFolder, "Editor/Scripting/ActorTemplate.cpp");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context proxy object for C++ Json Asset files.
|
||||
|
||||
@@ -1136,9 +1136,14 @@ namespace FlaxEditor.Modules
|
||||
Proxy.Add(new SceneAnimationProxy());
|
||||
Proxy.Add(new CSharpScriptProxy());
|
||||
Proxy.Add(new CSharpEmptyProxy());
|
||||
Proxy.Add(new CSharpEmptyClassProxy());
|
||||
Proxy.Add(new CSharpEmptyStructProxy());
|
||||
Proxy.Add(new CSharpEmptyInterfaceProxy());
|
||||
Proxy.Add(new CSharpActorProxy());
|
||||
Proxy.Add(new CppAssetProxy());
|
||||
Proxy.Add(new CppStaticClassProxy());
|
||||
Proxy.Add(new CppScriptProxy());
|
||||
Proxy.Add(new CppActorProxy());
|
||||
Proxy.Add(new SceneProxy());
|
||||
Proxy.Add(new PrefabProxy());
|
||||
Proxy.Add(new IESProfileProxy());
|
||||
|
||||
Reference in New Issue
Block a user