├── .gitattributes ├── Editor └── ScriptTemplates │ ├── HybridComponent.txt │ ├── IAspect.txt │ ├── IComponentData.txt │ ├── IBufferElementData.txt │ ├── AuthoringComponent.txt │ ├── UnmanagedSystem.txt │ └── ScriptTemplates.cs ├── README.md └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Editor/ScriptTemplates/HybridComponent.txt: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | #ROOTNAMESPACEBEGIN# 4 | public class #SCRIPTNAME# : IComponentData 5 | { 6 | 7 | } 8 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /Editor/ScriptTemplates/IAspect.txt: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | #ROOTNAMESPACEBEGIN# 4 | public readonly partial struct #SCRIPTNAME# : IAspect 5 | { 6 | 7 | } 8 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /Editor/ScriptTemplates/IComponentData.txt: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | #ROOTNAMESPACEBEGIN# 4 | public struct #SCRIPTNAME# : IComponentData 5 | { 6 | 7 | } 8 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /Editor/ScriptTemplates/IBufferElementData.txt: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | 3 | #ROOTNAMESPACEBEGIN# 4 | public struct #SCRIPTNAME# : IBufferElementData 5 | { 6 | 7 | } 8 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /Editor/ScriptTemplates/AuthoringComponent.txt: -------------------------------------------------------------------------------- 1 | using Unity.Entities; 2 | using UnityEngine; 3 | 4 | #ROOTNAMESPACEBEGIN# 5 | public class #SCRIPTNAME# : MonoBehaviour 6 | { 7 | 8 | class Baker : Baker<#SCRIPTNAME#> 9 | { 10 | public override void Bake(#SCRIPTNAME# authoring) 11 | { 12 | 13 | } 14 | } 15 | } 16 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/M4M8UEQP8) 2 | 3 | # DOTS Script Templates 4 | 5 | Contains a few useful **DOTS 1.0** Script template to reduce typing when making new **DOTS 1.0** scripts. 6 | You just need to copy the editor folder into your project. 7 | 8 | After that you will get new scripts creation option under "Create > DOTS" 9 | -------------------------------------------------------------------------------- /Editor/ScriptTemplates/UnmanagedSystem.txt: -------------------------------------------------------------------------------- 1 | using Unity.Burst; 2 | using Unity.Entities; 3 | 4 | #ROOTNAMESPACEBEGIN# 5 | [BurstCompile] 6 | public partial struct #SCRIPTNAME# : ISystem 7 | { 8 | [BurstCompile] 9 | public void OnCreate(ref SystemState state) 10 | { 11 | } 12 | [BurstCompile] 13 | public void OnDestroy(ref SystemState state) 14 | { 15 | } 16 | [BurstCompile] 17 | public void OnUpdate(ref SystemState state) 18 | { 19 | } 20 | } 21 | #ROOTNAMESPACEEND# -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 WAYN Games 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Editor/ScriptTemplates/ScriptTemplates.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using UnityEditor; 3 | 4 | namespace WaynGroup.Mgm.Ability.Editor 5 | { 6 | internal class ScriptTemplates 7 | { 8 | [MenuItem("Assets/Create/DOTS/IAspect")] 9 | public static void CreateIAspect() 10 | { 11 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 12 | $"Assets/Editor/ScriptTemplates/IAspect.txt", 13 | "IAspect.cs"); 14 | } 15 | 16 | [MenuItem("Assets/Create/DOTS/Unmanaged System")] 17 | public static void CreateUnmanagedSystem() 18 | { 19 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 20 | $"Assets/Editor/ScriptTemplates/UnmanagedSystem.txt", 21 | "UnmanagedSystem.cs"); 22 | } 23 | 24 | [MenuItem("Assets/Create/DOTS/Authoring Component")] 25 | public static void CreateAuthoringComponent() 26 | { 27 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 28 | $"Assets/Editor/ScriptTemplates/AuthoringComponent.txt", 29 | "AuthoringComponent.cs"); 30 | } 31 | 32 | [MenuItem("Assets/Create/DOTS/IComponentData")] 33 | public static void CreateIComponentData() 34 | { 35 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 36 | $"Assets/Editor/ScriptTemplates/IComponentData.txt", 37 | "IComponentData.cs"); 38 | } 39 | [MenuItem("Assets/Create/DOTS/IBufferElementData")] 40 | public static void CreateIBufferElementData() 41 | { 42 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 43 | $"Assets/Editor/ScriptTemplates/IBufferElementData.txt", 44 | "IBufferElementData.cs"); 45 | } 46 | [MenuItem("Assets/Create/DOTS/Hybrid Component")] 47 | public static void CreateHybridComponent() 48 | { 49 | ProjectWindowUtil.CreateScriptAssetFromTemplateFile( 50 | $"Assets/Editor/ScriptTemplates/HybridComponent.txt", 51 | "HybridComponent.cs"); 52 | } 53 | 54 | } 55 | } --------------------------------------------------------------------------------