Skip to content

Commit

Permalink
Added custom C# class template for Hazel Entity scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Nilsson committed May 31, 2022
1 parent d510ba1 commit c567039
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 0 deletions.
24 changes: 24 additions & 0 deletions HazelCSharpTemplateProject/Class.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Hazel;
using System;

namespace $rootnamespace$
{
public class $safeitemrootname$ : Entity
{

/// <summary>
/// OnCreate is called once when the Entity that this script is attached to
/// is instantiated in the scene at runtime
/// </summary>
protected override void OnCreate()
{
}

/// <summary>
/// OnUpdate is called once every frame while this script is active in the scene
/// </summary>
protected override void OnUpdate(float deltaTime)
{
}
}
}
75 changes: 75 additions & 0 deletions HazelCSharpTemplateProject/HazelCSharpTemplateProject.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HazelCSharpTemplateProject</RootNamespace>
<AssemblyName>HazelCSharpTemplateProject</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CreateVsixContainer>false</CreateVsixContainer>
<DeployExtension>false</DeployExtension>
<DeployVSTemplates>false</DeployVSTemplates>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.CoreUtility">
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Class.cs" />
<None Include="HazelCSharpTemplateProject.ico" />
</ItemGroup>
<ItemGroup>
<VSTemplate Include="HazelCSharpTemplateProject.vstemplate" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Binary file not shown.
18 changes: 18 additions & 0 deletions HazelCSharpTemplateProject/HazelCSharpTemplateProject.vstemplate
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010">
<TemplateData>
<Name>Hazel Entity Script</Name>
<Description>An empty C# script that inherits from Hazels Entity class</Description>
<Icon>HazelCSharpTemplateProject.ico</Icon>
<TemplateID>ffa4a5df-2e25-4234-9bf0-0cdea8d75db6</TemplateID>
<ProjectType>CSharp</ProjectType>
<LanguageTag>CSharp</LanguageTag>
<RequiredFrameworkVersion>4.7.2</RequiredFrameworkVersion>
<MaxFrameworkVersion>4.7.2</MaxFrameworkVersion>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<DefaultName>Class.cs</DefaultName>
</TemplateData>
<TemplateContent>
<ProjectItem ReplaceParameters="true">Class.cs</ProjectItem>
</TemplateContent>
</VSTemplate>
36 changes: 36 additions & 0 deletions HazelCSharpTemplateProject/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Hazel Visual Studio Templates Project")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Studio Cherno")]
[assembly: AssemblyProduct("HazelCSharpTemplateProject")]
[assembly: AssemblyCopyright("Copyright © Studio Cherno 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("46abafd5-dc8a-4441-82dd-4ad3928b6845")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
30 changes: 30 additions & 0 deletions HazelTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,52 @@ VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HazelTools", "HazelToolsVS\HazelTools.csproj", "{7D64803D-2F8D-4597-9762-A316C74E9816}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HazelCSharpTemplateProject", "HazelCSharpTemplateProject\HazelCSharpTemplateProject.csproj", "{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
net_4_5_Debug|Any CPU = net_4_5_Debug|Any CPU
net_4_5_Debug|x86 = net_4_5_Debug|x86
net_4_5_Release|Any CPU = net_4_5_Release|Any CPU
net_4_5_Release|x86 = net_4_5_Release|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D64803D-2F8D-4597-9762-A316C74E9816}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.Debug|x86.ActiveCfg = Debug|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.Debug|x86.Build.0 = Debug|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Debug|Any CPU.Build.0 = Debug|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Debug|x86.ActiveCfg = Debug|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Debug|x86.Build.0 = Debug|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Release|Any CPU.ActiveCfg = Release|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Release|Any CPU.Build.0 = Release|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Release|x86.ActiveCfg = Release|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.net_4_5_Release|x86.Build.0 = Release|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.Release|Any CPU.Build.0 = Release|Any CPU
{7D64803D-2F8D-4597-9762-A316C74E9816}.Release|x86.ActiveCfg = Release|x86
{7D64803D-2F8D-4597-9762-A316C74E9816}.Release|x86.Build.0 = Release|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Debug|x86.ActiveCfg = Debug|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Debug|x86.Build.0 = Debug|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Debug|Any CPU.ActiveCfg = Debug|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Debug|Any CPU.Build.0 = Debug|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Debug|x86.ActiveCfg = Debug|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Debug|x86.Build.0 = Debug|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Release|Any CPU.ActiveCfg = Release|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Release|Any CPU.Build.0 = Release|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Release|x86.ActiveCfg = Release|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.net_4_5_Release|x86.Build.0 = Release|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Release|Any CPU.Build.0 = Release|Any CPU
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Release|x86.ActiveCfg = Release|x86
{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
9 changes: 9 additions & 0 deletions HazelToolsVS/HazelTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HazelCSharpTemplateProject\HazelCSharpTemplateProject.csproj">
<Project>{46ABAFD5-DC8A-4441-82DD-4AD3928B6845}</Project>
<Name>HazelCSharpTemplateProject</Name>
<VSIXSubPath>ItemTemplates</VSIXSubPath>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<IncludeOutputGroupsInVSIX>TemplateProjectOutputGroup%3b</IncludeOutputGroupsInVSIX>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeNuGetResolvedAssets</GetVsixSourceItemsDependsOn>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions HazelToolsVS/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</InstallationTarget>
</Installation>
<Assets>
<Asset Type="Microsoft.VisualStudio.ItemTemplate" d:Source="Project" d:ProjectName="HazelCSharpTemplateProject" d:TargetPath="|HazelCSharpTemplateProject;TemplateProjectOutputGroup|" Path="ItemTemplates" d:VsixSubPath="ItemTemplates" />
</Assets>
<Prerequisites>
<Prerequisite Id="Microsoft.VisualStudio.Component.MonoDebugger" Version="[17.0,)" DisplayName="Mono debugger" />
Expand Down

0 comments on commit c567039

Please sign in to comment.