@@ -119,6 +119,31 @@ private static string GenerateCreateMethodTempVariables(List<CommandProperty> co
119119 {
120120 properties . AppendLine ( $ "var { property . CodeProperty } = (CommandId)((int)json[\" { property . Name } \" ]);") ;
121121 }
122+ else if ( property . Type is CommandPropertyType . Vector2 )
123+ {
124+ properties . AppendLine ( $ "var { property . CodeProperty } Array = json[\" { property . Name } \" ];") ;
125+ properties . AppendLine ( $ "var { property . CodeProperty } = new global::UnityEngine.Vector2((float){ property . CodeProperty } Array[0], (float){ property . CodeProperty } Array[1]);") ;
126+ }
127+ else if ( property . Type is CommandPropertyType . Vector3 )
128+ {
129+ properties . AppendLine ( $ "var { property . CodeProperty } Array = json[\" { property . Name } \" ];") ;
130+ properties . AppendLine ( $ "var { property . CodeProperty } = new global::UnityEngine.Vector3((float){ property . CodeProperty } Array[0], (float){ property . CodeProperty } Array[1], (float){ property . CodeProperty } Array[2]);") ;
131+ }
132+ else if ( property . Type is CommandPropertyType . Vector4 )
133+ {
134+ properties . AppendLine ( $ "var { property . CodeProperty } Array = json[\" { property . Name } \" ];") ;
135+ properties . AppendLine ( $ "var { property . CodeProperty } = new global::UnityEngine.Vector4((float){ property . CodeProperty } Array[0], (float){ property . CodeProperty } Array[1], (float){ property . CodeProperty } Array[2], (float){ property . CodeProperty } Array[3]);") ;
136+ }
137+ else if ( property . Type is CommandPropertyType . Vector2Int )
138+ {
139+ properties . AppendLine ( $ "var { property . CodeProperty } Array = json[\" { property . Name } \" ];") ;
140+ properties . AppendLine ( $ "var { property . CodeProperty } = new global::UnityEngine.Vector2Int((int){ property . CodeProperty } Array[0], (int){ property . CodeProperty } Array[1]);") ;
141+ }
142+ else if ( property . Type is CommandPropertyType . Vector3Int )
143+ {
144+ properties . AppendLine ( $ "var { property . CodeProperty } Array = json[\" { property . Name } \" ];") ;
145+ properties . AppendLine ( $ "var { property . CodeProperty } = new global::UnityEngine.Vector3Int((int){ property . CodeProperty } Array[0], (int){ property . CodeProperty } Array[1], (int){ property . CodeProperty } Array[2]);") ;
146+ }
122147 else
123148 {
124149 properties . AppendLine ( $ "var { property . CodeProperty } = ({ type } )json[\" { property . Name } \" ];") ;
@@ -173,6 +198,11 @@ private static string GetTypeCode(CommandPropertyType type)
173198 CommandPropertyType . Float => "float" ,
174199 CommandPropertyType . Bool => "bool" ,
175200 CommandPropertyType . CommandId => "CommandId" ,
201+ CommandPropertyType . Vector2 => "global::UnityEngine.Vector2" ,
202+ CommandPropertyType . Vector3 => "global::UnityEngine.Vector3" ,
203+ CommandPropertyType . Vector4 => "global::UnityEngine.Vector4" ,
204+ CommandPropertyType . Vector2Int => "global::UnityEngine.Vector2Int" ,
205+ CommandPropertyType . Vector3Int => "global::UnityEngine.Vector3Int" ,
176206 _ => throw new ArgumentOutOfRangeException ( nameof ( type ) , type , null )
177207 } ;
178208 }
0 commit comments