1+ {
2+ "Dots Create ISystem" : {
3+ "prefix" : " dcs" ,
4+ "body" : [
5+ " using Unity.Burst;" ,
6+ " using Unity.Entities;" ,
7+ " using Unity.Mathematics;" ,
8+ " using Unity.Transforms;" ,
9+ " " ,
10+ " namespace ${1}" ,
11+ " {" ,
12+ " \t [BurstCompile]" ,
13+ " \t public partial struct ${2:$TM_FILENAME_BASE} : ISystem" ,
14+ " \t {" ,
15+ " \t\t public void OnCreate(ref SystemState state)" ,
16+ " \t\t {" ,
17+ " \t\t\t ${0}" ,
18+ " \t\t }" ,
19+ " " ,
20+ " \t\t [BurstCompile]" ,
21+ " \t\t public void OnUpdate(ref SystemState state)" ,
22+ " \t\t {" ,
23+ " \t\t\t " ,
24+ " \t\t }" ,
25+ " " ,
26+ " \t\t public void OnDestroy(ref SystemState state)" ,
27+ " \t\t {" ,
28+ " \t\t\t " ,
29+ " \t\t }" ,
30+ " \t }" ,
31+ " }"
32+ ],
33+ "description" : " Create a Unity DOTS System with the ISystem interface"
34+ },
35+ "Dots Create ISystem w/ onStart onStop" : {
36+ "prefix" : " dcsss" ,
37+ "body" : [
38+ " using Unity.Burst;" ,
39+ " using Unity.Entities;" ,
40+ " using Unity.Mathematics;" ,
41+ " using Unity.Transforms;" ,
42+ " " ,
43+ " namespace ${1}" ,
44+ " {" ,
45+ " \t [BurstCompile]" ,
46+ " \t public partial struct ${2:$TM_FILENAME_BASE} : ISystem, ISystemStartStop" ,
47+ " \t {" ,
48+ " \t\t public void OnCreate(ref SystemState state)" ,
49+ " \t\t {" ,
50+ " \t\t\t ${0}" ,
51+ " \t\t }" ,
52+ " " ,
53+ " \t\t [BurstCompile]" ,
54+ " \t\t public void OnUpdate(ref SystemState state)" ,
55+ " \t\t {" ,
56+ " \t\t\t " ,
57+ " \t\t }" ,
58+ " " ,
59+ " \t\t public void OnDestroy(ref SystemState state)" ,
60+ " \t\t {" ,
61+ " \t\t\t " ,
62+ " \t\t }" ,
63+ " \t }" ,
64+ " \t\t public void OnStartRunning(ref SystemState state)" ,
65+ " \t\t {" ,
66+ " \t\t\t " ,
67+ " \t\t }" ,
68+ " " ,
69+ " \t\t public void OnStopRunning(ref SystemState state)" ,
70+ " \t\t {" ,
71+ " \t\t\t " ,
72+ " \t\t }" ,
73+ " \t }" ,
74+ " }"
75+ ],
76+ "description" : " Create a Unity DOTS ISystem with onStartRunning & onStopRunning callbacks"
77+ },
78+ "Dots Create SystemBase" : {
79+ "prefix" : " dcsb" ,
80+ "body" : [
81+ " using Unity.Entities;" ,
82+ " using Unity.Mathematics;" ,
83+ " using Unity.Transforms;" ,
84+ " " ,
85+ " namespace ${1}" ,
86+ " {" ,
87+ " \t public partial class ${2:$TM_FILENAME_BASE} : SystemBase" ,
88+ " \t {" ,
89+ " \t\t protected override void OnCreate()" ,
90+ " \t\t {" ,
91+ " \t\t\t ${0}" ,
92+ " \t\t }" ,
93+ " " ,
94+ " \t\t protected override void OnUpdate()" ,
95+ " \t\t {" ,
96+ " \t\t\t " ,
97+ " \t\t }" ,
98+ " " ,
99+ " \t\t protected override void OnDestroy()" ,
100+ " \t\t {" ,
101+ " \t\t\t " ,
102+ " \t\t }" ,
103+ " \t\t protected override void OnStartRunning()" ,
104+ " \t\t {" ,
105+ " \t\t\t " ,
106+ " \t\t }" ,
107+ " " ,
108+ " \t\t protected override void OnStopRunning()" ,
109+ " \t\t {" ,
110+ " \t\t\t " ,
111+ " \t\t }" ,
112+ " \t }" ,
113+ " }"
114+ ],
115+ "description" : " Create a managed Unity DOTS System with the SystemBase class"
116+ },
117+ "Dots Create Unmanaged Component" : {
118+ "prefix" : " dcc" ,
119+ "body" : [
120+ " using Unity.Entities;" ,
121+ " " ,
122+ " namespace ${1}" ,
123+ " {" ,
124+ " \t public struct ${2:$TM_FILENAME_BASE} : IComponentData" ,
125+ " \t {" ,
126+ " \t\t public ${3:int} ${4:value};${0}" ,
127+ " \t }" ,
128+ " }"
129+ ],
130+ "description" : " Create a Unity DOTS unmanaged component (recommended if using blittable types)"
131+ },
132+ "Dots Create Managed Component" : {
133+ "prefix" : " dcmc" ,
134+ "body" : [
135+ " using Unity.Entities;" ,
136+ " " ,
137+ " namespace ${1}" ,
138+ " {" ,
139+ " \t public class ${2:$TM_FILENAME_BASE} : IComponentData" ,
140+ " \t {" ,
141+ " \t\t public ${3:string} ${4:value};${0}" ,
142+ " \t }" ,
143+ " }"
144+ ],
145+ "description" : " Create a Unity DOTS managed component (only if using NON-blittable types)"
146+ },
147+ "Dots Create Managed Component w/ External Resource" : {
148+ "prefix" : " dcmcer" ,
149+ "body" : [
150+ " using System;" ,
151+ " using UnityEngine;" ,
152+ " using Unity.Entities;" ,
153+ " " ,
154+ " namespace ${1}" ,
155+ " {" ,
156+ " \t public class ${2:$TM_FILENAME_BASE} : IComponentData, IDisposable, ICloneable" ,
157+ " \t {" ,
158+ " \t\t public ${3:ParticleSystem} ${4:ParticleSystem};${0}" ,
159+ " " ,
160+ " \t\t public void Dispose()" ,
161+ " \t\t {" ,
162+ " \t\t\t //garbage collection when this component is destroyed" ,
163+ " \t\t\t UnityEngine.Object.Destroy(${4:ParticleSystem});" ,
164+ " \t\t }" ,
165+ " " ,
166+ " \t\t public object Clone()" ,
167+ " \t\t {" ,
168+ " \t\t\t //duplicate a new particle system when this entity is duplicated" ,
169+ " \t\t\t //so that all copy entity instances do not use the same external resource" ,
170+ " \t\t\t return new ${2:$TM_FILENAME_BASE} {" ,
171+ " \t\t\t\t ${4:ParticleSystem} = UnityEngine.Object.Instantiate(${4:ParticleSystem})" ,
172+ " \t\t\t };" ,
173+ " \t\t }" ,
174+ " \t }" ,
175+ " }"
176+ ],
177+ "description" : " Create a Unity DOTS managed component referencing an external resource"
178+ },
179+ "Dots Create Unmanaged Shared Component" : {
180+ "prefix" : " dcsc" ,
181+ "body" : [
182+ " using Unity.Entities;" ,
183+ " " ,
184+ " namespace ${1}" ,
185+ " {" ,
186+ " \t public struct ${2:$TM_FILENAME_BASE} : ISharedComponentData" ,
187+ " \t {" ,
188+ " \t\t public ${3:int} ${4:value};${0}" ,
189+ " \t }" ,
190+ " }"
191+ ],
192+ "description" : " Create a Unity DOTS unmanaged shared component (for components used on many entities & with the same values)"
193+ },
194+ "Dots Create Managed Shared Component" : {
195+ "prefix" : " dcmsc" ,
196+ "body" : [
197+ " using System;" ,
198+ " using Unity.Entities;" ,
199+ " " ,
200+ " namespace ${1}" ,
201+ " {" ,
202+ " \t public struct ${2:$TM_FILENAME_BASE} : ISharedComponentData, IEquatable<${2:$TM_FILENAME_BASE}>" ,
203+ " \t {" ,
204+ " \t\t public ${3:string} ${4:value};${0}" ,
205+ " " ,
206+ " \t\t public bool Equals(${2:$TM_FILENAME_BASE} other)" ,
207+ " \t\t {" ,
208+ " \t\t\t return ${4:value}.Equals(other.${4:value});" ,
209+ " \t\t }" ,
210+ " " ,
211+ " \t\t public override int GetHashCode()" ,
212+ " \t\t {" ,
213+ " \t\t\t return ${4:value}.GetHashCode();" ,
214+ " \t\t }" ,
215+ " \t }" ,
216+ " }"
217+ ],
218+ "description" : " Create a Unity DOTS managed shared component (for shared components using non-blittable types)"
219+ },
220+ "Dots Create Tag Component" : {
221+ "prefix" : " dctc" ,
222+ "body" : [
223+ " using Unity.Entities;" ,
224+ " " ,
225+ " namespace ${1}" ,
226+ " {" ,
227+ " \t public struct ${2:$TM_FILENAME_BASE} : IComponentData { }" ,
228+ " }"
229+ ],
230+ "description" : " Create a Unity DOTS tag component"
231+ },
232+ "Dots Create Job" : {
233+ "prefix" : " dcj" ,
234+ "body" : [
235+ " public partial struct ${2:Calculation}Job : IJobEntity" ,
236+ " {" ,
237+ " \t void Execute(ref ${3:Component} ${4:component})" ,
238+ " \t {" ,
239+ " \t\t ${0}" ,
240+ " \t }" ,
241+ " }"
242+ ],
243+ "description" : " Create a Unity DOTS Job"
244+ }
245+ }
0 commit comments