@@ -17,6 +17,7 @@ public class GenerateFileEditorWindow : EditorWindow {
1717 private string fileName ;
1818 private bool shouldOverwriteAllVirtuals ;
1919 private bool shouldImportCommonNamespaces ;
20+ private bool shouldAddFileHeaderComments ;
2021
2122 [ MenuItem ( "ECS/Generate Controller" , false , 100 ) ]
2223 private static void GenerateNewController ( ) {
@@ -53,6 +54,7 @@ private void OnGUI () {
5354 GUILayout . FlexibleSpace ( ) ;
5455 this . shouldImportCommonNamespaces = GUILayout . Toggle ( this . shouldImportCommonNamespaces , " Import Common Namespaces" ) ;
5556 this . shouldOverwriteAllVirtuals = GUILayout . Toggle ( this . shouldOverwriteAllVirtuals , " Overwrite All Virtuals" ) ;
57+ this . shouldAddFileHeaderComments = GUILayout . Toggle ( this . shouldAddFileHeaderComments , " Add File Header Comments" ) ;
5658 GUILayout . FlexibleSpace ( ) ;
5759 if ( GenerateFileEditorWindow . generateFileType == GenerateFileType . Controller ) {
5860 if ( GUILayout . Button ( "Generate " + this . fileName + "Controller" ) )
@@ -72,6 +74,7 @@ private void OnGUI () {
7274 private void Generate ( ) {
7375 var _overwriteAllVirtuals = this . shouldOverwriteAllVirtuals ;
7476 var _importCommonNamespaces = this . shouldImportCommonNamespaces ;
77+ var _addFileHeaderComments = this . shouldAddFileHeaderComments ;
7578 var _fileName = this . fileName ;
7679 this . fileName = "" ;
7780
@@ -80,7 +83,14 @@ private void Generate () {
8083 _importCommonNamespaces ? "using UnityEngine;" : null ,
8184 "using ElRaccoone.EntityComponentSystem;" ,
8285 _importCommonNamespaces ? "using System.Collections.Generic;" : null ,
83- "public class " + _fileName + "Controller : Controller {" ,
86+ "" ,
87+ _addFileHeaderComments ? "/*" : null ,
88+ _addFileHeaderComments ? " * Project: " + PlayerSettings . productName : null ,
89+ _addFileHeaderComments ? " * Author: " : null ,
90+ _addFileHeaderComments ? " *" : null ,
91+ _addFileHeaderComments ? " * Controller for " + _fileName + "." : null ,
92+ _addFileHeaderComments ? " */" : null ,
93+ "public class " + _fileName + "Controller : Controller {" ,
8494 "\t public override void OnInitialize () {" ,
8595 "\t \t this.Register();" ,
8696 "\t }" ,
@@ -94,6 +104,13 @@ private void Generate () {
94104 _importCommonNamespaces ? "using UnityEngine;" : null ,
95105 "using ElRaccoone.EntityComponentSystem;" ,
96106 _importCommonNamespaces ? "using System.Collections.Generic;" : null ,
107+ "" ,
108+ _addFileHeaderComments ? "/*" : null ,
109+ _addFileHeaderComments ? " * Project: " + PlayerSettings . productName : null ,
110+ _addFileHeaderComments ? " * Author: " : null ,
111+ _addFileHeaderComments ? " *" : null ,
112+ _addFileHeaderComments ? " * Entity Component for " + _fileName + "." : null ,
113+ _addFileHeaderComments ? " */" : null ,
97114 "public class " + _fileName + "Component : EntityComponent<" + _fileName + "Component, " + _fileName + "System> {" ,
98115 "}"
99116 } ) ;
@@ -103,6 +120,13 @@ private void Generate () {
103120 _importCommonNamespaces ? "using UnityEngine;" : null ,
104121 "using ElRaccoone.EntityComponentSystem;" ,
105122 _importCommonNamespaces ? "using System.Collections.Generic;" : null ,
123+ "" ,
124+ _addFileHeaderComments ? "/*" : null ,
125+ _addFileHeaderComments ? " * Project: " + PlayerSettings . productName : null ,
126+ _addFileHeaderComments ? " * Author: " : null ,
127+ _addFileHeaderComments ? " *" : null ,
128+ _addFileHeaderComments ? " * Entity System for " + _fileName + "." : null ,
129+ _addFileHeaderComments ? " */" : null ,
106130 "public class " + _fileName + "System : EntitySystem<" + _fileName + "System, " + _fileName + "Component> {" ,
107131 _overwriteAllVirtuals ? "\t public override void OnInitialize () { }" : null ,
108132 _overwriteAllVirtuals ? "\t public override void OnInitialized () { }" : null ,
@@ -125,6 +149,13 @@ private void Generate () {
125149 _importCommonNamespaces ? "using UnityEngine;" : null ,
126150 "using ElRaccoone.EntityComponentSystem;" ,
127151 _importCommonNamespaces ? "using System.Collections.Generic;" : null ,
152+ "" ,
153+ _addFileHeaderComments ? "/*" : null ,
154+ _addFileHeaderComments ? " * Project: " + PlayerSettings . productName : null ,
155+ _addFileHeaderComments ? " * Author: " : null ,
156+ _addFileHeaderComments ? " *" : null ,
157+ _addFileHeaderComments ? " * Service for " + _fileName + "." : null ,
158+ _addFileHeaderComments ? " */" : null ,
128159 "public class " + _fileName + "Service : Service<" + _fileName + "Service> {" ,
129160 _overwriteAllVirtuals ? "\t public override void OnInitialize () { }" : null ,
130161 _overwriteAllVirtuals ? "\t public override void OnInitialized () { }" : null ,
0 commit comments