Skip to content

Commit efe3962

Browse files
Removed clamped variables from code gen
1 parent 7172df8 commit efe3962

File tree

2 files changed

+32
-54
lines changed

2 files changed

+32
-54
lines changed

Assets/SO Architecture/Editor/Code Generation/SO_CodeGenerationWindow.cs

+13-32
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public class SO_CodeGenerationWindow : EditorWindow
1313
* [4] Collection
1414
* [5] Unity Event
1515
* [6] Variable
16-
* [7] Clamped Variable
1716
*
1817
* / 1 2 3 4 5 6 7
1918
* 1 X X
@@ -22,39 +21,34 @@ public class SO_CodeGenerationWindow : EditorWindow
2221
* 4
2322
* 5
2423
* 6
25-
* 7 X X
2624
*/
2725

2826
private readonly bool[,] _dependencyGraph = new bool[SO_CodeGenerator.TYPE_COUNT, SO_CodeGenerator.TYPE_COUNT]
2927
{
30-
{ false, true, false, false, true, false, false },
31-
{ false, false, true, false, false, false, false },
32-
{ false, false, false, false, false, true, false },
33-
{ false, false, false, false, false, false, false },
34-
{ false, false, false, false, false, false, false },
35-
{ false, false, false, false, false, false, false },
36-
{ false, false, true, false, false, true, false },
28+
{ false, true, false, false, true, false, },
29+
{ false, false, true, false, false, false, },
30+
{ false, false, false, false, false, true, },
31+
{ false, false, false, false, false, false, },
32+
{ false, false, false, false, false, false, },
33+
{ false, false, false, false, false, false, },
3734
};
3835

3936
private readonly bool[] _states = new bool[SO_CodeGenerator.TYPE_COUNT];
4037
private readonly string[] _names = new string[SO_CodeGenerator.TYPE_COUNT]
4138
{
42-
"Event Listener",
43-
"Game Event",
44-
"Reference",
45-
"Collection",
46-
"Unity Event",
47-
"Variable",
48-
"Clamped Variable",
39+
"Event Listener",
40+
"Game Event",
41+
"Reference",
42+
"Collection",
43+
"Unity Event",
44+
"Variable",
4945
};
5046

5147
private readonly bool[] _menuRequirement = new bool[SO_CodeGenerator.TYPE_COUNT]
5248
{
53-
false, true, false, true, false, true, true
49+
false, true, false, true, false, true
5450
};
5551

56-
private const int INDEX_CLAMPED_VARIABLE = 6;
57-
5852
private int _order;
5953
private string _typeName;
6054
private string _menuName;
@@ -83,7 +77,6 @@ private void OnGUI()
8377
EditorGUILayout.Space();
8478

8579
DataFields();
86-
ClampedVariableHelpBox();
8780

8881
if (GUILayout.Button("Generate"))
8982
{
@@ -118,18 +111,6 @@ private void TypeSelection()
118111
EditorGUI.EndDisabledGroup();
119112
}
120113
}
121-
private void ClampedVariableHelpBox()
122-
{
123-
_clampedValueHelpBoxAnim.target = _states[INDEX_CLAMPED_VARIABLE];
124-
125-
using (var anim = new EditorGUILayout.FadeGroupScope(_clampedValueHelpBoxAnim.faded))
126-
{
127-
if (anim.visible)
128-
EditorGUILayout.HelpBox(
129-
"Clamped variables comes with a generic clamp function, but it might need adjustments based on your type",
130-
MessageType.Warning);
131-
}
132-
}
133114
private void DataFields()
134115
{
135116
EditorGUILayout.LabelField("Information", EditorStyles.boldLabel);

Assets/SO Architecture/Editor/Code Generation/SO_CodeGenerator.cs

+19-22
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ private static void CreateTargetDirectories()
1717
{
1818
_targetDirectories = new string[TYPE_COUNT]
1919
{
20-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Listeners",
21-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Game Events",
22-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/References",
23-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Collections",
24-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Responses",
25-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Variables",
26-
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Variables/Clamped",
20+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Listeners",
21+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Game Events",
22+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/References",
23+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Collections",
24+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Events/Responses",
25+
Application.dataPath + "/" + SOArchitecture_Settings.Instance.CodeGenerationTargetDirectory + "/Variables",
2726
};
2827
}
2928
private static void GatherFilePaths()
@@ -61,7 +60,7 @@ private static void GatherFilePaths()
6160
}
6261
}
6362

64-
public const int TYPE_COUNT = 7;
63+
public const int TYPE_COUNT = 6;
6564

6665
public struct Data
6766
{
@@ -73,24 +72,22 @@ public struct Data
7372

7473
private static string[] _templateNames = new string[TYPE_COUNT]
7574
{
76-
"GameEventListenerTemplate",
77-
"GameEventTemplate",
78-
"ReferenceTemplate",
79-
"CollectionTemplate",
80-
"UnityEventTemplate",
81-
"VariableTemplate",
82-
"ClampedVariableTemplate",
75+
"GameEventListenerTemplate",
76+
"GameEventTemplate",
77+
"ReferenceTemplate",
78+
"CollectionTemplate",
79+
"UnityEventTemplate",
80+
"VariableTemplate",
8381
};
8482

8583
private static string[] _targetFileNames = new string[TYPE_COUNT]
8684
{
87-
"{0}GameEventListener.cs",
88-
"{0}GameEvent.cs",
89-
"{0}Reference.cs",
90-
"{0}Collection.cs",
91-
"{0}UnityEvent.cs",
92-
"{0}Variable.cs",
93-
"{0}ClampedVariable.cs",
85+
"{0}GameEventListener.cs",
86+
"{0}GameEvent.cs",
87+
"{0}Reference.cs",
88+
"{0}Collection.cs",
89+
"{0}UnityEvent.cs",
90+
"{0}Variable.cs",
9491
};
9592

9693
private static string[] _targetDirectories = null;

0 commit comments

Comments
 (0)