Skip to content

Commit f1f6248

Browse files
committed
Apply new layout
1 parent 90f20ae commit f1f6248

File tree

10 files changed

+167
-120
lines changed

10 files changed

+167
-120
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void OnGUI()
6060
/// </summary>
6161
public static void ReadINIFile()
6262
{
63-
INI_FILE_PATH = JCS_Path.Combine(Application.dataPath, "/JCSUnity/Editors/ini/");
63+
INI_FILE_PATH = JCS_Path.Combine(Application.dataPath, "/JCSUnity/Editor/ini/");
6464

6565
string path = JCS_Path.Combine(INI_FILE_PATH, EDITOR_PROPERTIES_FILENAME);
6666

File renamed without changes.

Assets/JCSUnity/Editors/JCSUnity_EditorWindow.cs renamed to Assets/JCSUnity/Editor/JCSUnity_EditorWindow.cs

Lines changed: 98 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public class JCSUnity_EditorWindow
2727

2828
public static JCSUnity_EditorWindow instance = null;
2929

30-
public int GAME_PAD_COUNT = 0; // How many gampad in this game?
31-
3230
public string PROJECT_NAME = "";
3331

3432
public const string PROJECT_NAME_LASTING = "_Assets";
@@ -46,32 +44,13 @@ public class JCSUnity_EditorWindow
4644
"Sprites",
4745
};
4846

49-
public int SelectGamepadType = 0;
50-
public string[] GamepadPlatform = {
51-
"Select Platform",
52-
53-
/* Sony Play Station */
54-
"PS",
55-
"PS2",
56-
"PS3",
57-
"PS4",
58-
59-
/* Microsoft XBox */
60-
"XBox",
61-
"XBox 360",
62-
"XBox One",
63-
};
64-
65-
private bool mOCSFoldeout = false; // OCS = One click serialize
66-
private bool mBOFoldout = false; // BO = Bases Object
67-
private bool mGUIFoldout = false;
68-
private bool m2DFoldout = false;
69-
private bool m3DFoldout = false;
70-
private bool mARVRFoldout = false; // ARVR = AR / VR
71-
72-
private bool mInputFoldout = false; // Input
73-
74-
private bool mToolFoldout = false; // Utitlies
47+
private bool mFO_Scene = false;
48+
private bool mFO_Basic = false;
49+
private bool mFO_GUI = false;
50+
private bool mFO_Effect = false;
51+
private bool mFO_ARVR = false;
52+
private bool mFO_Input = false;
53+
private bool mFO_Tool = false;
7554

7655
/* Setter & Getter */
7756

@@ -86,89 +65,111 @@ private void OnGUI()
8665
{
8766
JCSUnity_About.ReadINIFile();
8867

89-
GUILayout.Label("** Editor Settings **", EditorStyles.boldLabel);
90-
91-
mOCSFoldeout = EditorGUILayout.Foldout(mOCSFoldeout, "One click serialize");
92-
if (mOCSFoldeout)
93-
PartOneClickSerialize();
68+
mFO_Scene = EditorGUILayout.Foldout(mFO_Scene, "Scene");
69+
if (mFO_Scene)
70+
JCSUnity_EditortUtil.CreateGroup(Part_Scene);
9471

95-
mBOFoldout = EditorGUILayout.Foldout(mBOFoldout, "Bases Object");
96-
if (mBOFoldout)
97-
PartBaseObject();
72+
mFO_Basic = EditorGUILayout.Foldout(mFO_Basic, "Basic");
73+
if (mFO_Basic)
74+
JCSUnity_EditortUtil.CreateGroup(Part_Basic);
9875

99-
mGUIFoldout = EditorGUILayout.Foldout(mGUIFoldout, "GUI");
100-
if (mGUIFoldout)
101-
PartGUI();
76+
mFO_GUI = EditorGUILayout.Foldout(mFO_GUI, "GUI");
77+
if (mFO_GUI)
78+
JCSUnity_EditortUtil.CreateGroup(Part_GUI);
10279

103-
m2DFoldout = EditorGUILayout.Foldout(m2DFoldout, "2D");
104-
if (m2DFoldout)
105-
Part2D();
80+
mFO_Effect = EditorGUILayout.Foldout(mFO_Effect, "Effect");
81+
if (mFO_Effect)
82+
JCSUnity_EditortUtil.CreateGroup(Part_Effect);
10683

107-
m3DFoldout = EditorGUILayout.Foldout(m3DFoldout, "3D");
108-
if (m3DFoldout)
109-
Part3D();
84+
mFO_ARVR = EditorGUILayout.Foldout(mFO_ARVR, "AR / VR");
85+
if (mFO_ARVR)
86+
JCSUnity_EditortUtil.CreateGroup(Part_ARVR);
11087

111-
mARVRFoldout = EditorGUILayout.Foldout(mARVRFoldout, "AR / VR");
112-
if (mARVRFoldout)
113-
PartARVR();
88+
mFO_Input = EditorGUILayout.Foldout(mFO_Input, "Input");
89+
if (mFO_Input)
90+
JCSUnity_EditortUtil.CreateGroup(Part_Input);
11491

115-
mInputFoldout = EditorGUILayout.Foldout(mInputFoldout, "Input");
116-
if (mInputFoldout)
117-
PartInput();
118-
119-
mToolFoldout = EditorGUILayout.Foldout(mToolFoldout, "Tool");
120-
if (mToolFoldout)
121-
PartTool();
92+
mFO_Tool = EditorGUILayout.Foldout(mFO_Tool, "Tool");
93+
if (mFO_Tool)
94+
JCSUnity_EditortUtil.CreateGroup(Part_Tool);
12295
}
12396

12497
/// <summary>
12598
/// Initialize the one click serialize part buttons.
12699
/// </summary>
127-
private void PartOneClickSerialize()
100+
private void Part_Scene()
128101
{
129-
if (GUILayout.Button("Serialize scene to JCSUnity 2D interface"))
130-
SerializeToJCSUnity2D();
102+
JCSUnity_EditortUtil.BeginHorizontal(() =>
103+
{
104+
if (GUILayout.Button("Convert to 2D scene"))
105+
SerializeToJCSUnity2D();
106+
107+
if(GUILayout.Button("Convert to 3D scene"))
108+
SerializeToJCSUnity3D();
109+
});
131110

132-
if (GUILayout.Button("Serialize scene to JCSUnity 3D interface"))
133-
SerializeToJCSUnity3D();
134111
}
135112

136113
/// <summary>
137-
/// Initialize the base object part buttons.
114+
/// Initialize the base object part buttons.
138115
/// </summary>
139-
private void PartBaseObject()
116+
private void Part_Basic()
140117
{
141-
if (GUILayout.Button("Create JCSUnity setting"))
142-
CreateJCSSettings();
118+
GUILayout.Label("Managers / Settings", EditorStyles.boldLabel);
119+
120+
JCSUnity_EditortUtil.BeginHorizontal(() =>
121+
{
122+
if (GUILayout.Button("Create Settings"))
123+
CreateJCSSettings();
124+
125+
if (GUILayout.Button("Create Managers"))
126+
CreateJCSManagers();
127+
});
128+
129+
GUILayout.Label("Camera", EditorStyles.boldLabel);
143130

144-
if (GUILayout.Button("Create JCSUnity manager"))
145-
CreateJCSManagers();
131+
JCSUnity_EditortUtil.BeginHorizontal(() =>
132+
{
133+
if (GUILayout.Button("Create 2D camera"))
134+
Create2DCamera();
135+
136+
if (GUILayout.Button("Create 3D camera"))
137+
Create3DCamera();
138+
});
146139

147-
if (GUILayout.Button("Create JCSUnity canvas"))
140+
GUILayout.Label("Canvas", EditorStyles.boldLabel);
141+
142+
if (GUILayout.Button("Create Canvas"))
148143
CreateJCSCanvas();
149144

145+
GUILayout.Label("Background Music", EditorStyles.boldLabel);
146+
150147
if (GUILayout.Button("Create BGM Player"))
151148
CreateJCSBGMPlayer();
152149

150+
GUILayout.Label("Debug Tools", EditorStyles.boldLabel);
151+
153152
if (GUILayout.Button("Create Debug Tools"))
154153
CreateDebugTools();
155154
}
156155

157156
/// <summary>
158157
/// Compile the GUI part to Unity's GUI inspector.
159158
/// </summary>
160-
private void PartGUI()
159+
private void Part_GUI()
161160
{
162-
GUILayout.Label("** Cursor **");
163-
164-
if (GUILayout.Button("Create 2D Cursor"))
165-
Create2DCurosr();
161+
GUILayout.Label("Cursor", EditorStyles.boldLabel);
166162

167-
if (GUILayout.Button("Create 3D Cursor"))
168-
Create3DCurosr();
163+
JCSUnity_EditortUtil.BeginHorizontal(() =>
164+
{
165+
if (GUILayout.Button("Create 2D Cursor"))
166+
Create2DCurosr();
169167

168+
if (GUILayout.Button("Create 3D Cursor"))
169+
Create3DCurosr();
170+
});
170171

171-
GUILayout.Label("** Panel **");
172+
GUILayout.Label("Panel", EditorStyles.boldLabel);
172173

173174
if (GUILayout.Button("Create Base Panel"))
174175
CreateBasePanel();
@@ -183,74 +184,58 @@ private void PartGUI()
183184
CreateSlidePanel();
184185

185186

186-
GUILayout.Label("** Undo/Redo **");
187+
GUILayout.Label("Undo/Redo", EditorStyles.boldLabel);
187188

188189
if (GUILayout.Button("Create Undo Redo System"))
189190
CreateUndoRedoSystem();
190191
}
191192

192193
/// <summary>
193-
/// Compile the 2D part to GUI inspector.
194+
/// Compile the Effect inspector.
194195
/// </summary>
195-
private void Part2D()
196+
private void Part_Effect()
196197
{
197-
GUILayout.Label("** Camera **");
198-
199-
if (GUILayout.Button("Create 2D camera"))
200-
Create2DCamera();
201-
202-
GUILayout.Label("** Effects **");
198+
GUILayout.Label("Damage Text", EditorStyles.boldLabel);
203199

204200
if (GUILayout.Button("Create mix damage pool"))
205201
CreateMixDamageTextPool();
206202
}
207203

208-
/// <summary>
209-
/// Compile the 3D part to GUI inspector.
210-
/// </summary>
211-
private void Part3D()
212-
{
213-
GUILayout.Label("** Camera **");
214-
215-
if (GUILayout.Button("Create 3D camera"))
216-
Create3DCamera();
217-
}
218-
219204
/// <summary>
220205
/// Compile the AR/VR part to GUI inspector.
221206
/// </summary>
222-
private void PartARVR()
207+
private void Part_ARVR()
223208
{
224209
GUILayout.Label("N/A...");
225210
}
226211

227212
/// <summary>
228213
/// Compile the Input part to Input inspector.
229214
/// </summary>
230-
private void PartInput()
215+
private void Part_Input()
231216
{
232-
GUILayout.Label("** Game Pad count **");
217+
GUILayout.Label("Gamepad", EditorStyles.boldLabel);
233218

234-
instance.SelectGamepadType = EditorGUILayout.Popup("Gamepad Type", instance.SelectGamepadType, GamepadPlatform);
219+
JCS_InputController.SelectGamepadType = EditorGUILayout.Popup("Gamepad Type", JCS_InputController.SelectGamepadType, JCS_InputController.GamepadPlatform);
235220

236-
instance.GAME_PAD_COUNT = (int)EditorGUILayout.Slider(instance.GAME_PAD_COUNT, 0, JCS_InputSettings.MAX_JOYSTICK_COUNT);
221+
JCS_InputController.GAME_PAD_COUNT = (int)EditorGUILayout.Slider("Gamepad Count", JCS_InputController.GAME_PAD_COUNT, 0, JCS_InputSettings.MAX_JOYSTICK_COUNT);
237222

238-
if (GUILayout.Button("Add Input Manager depends on target gamepad type"))
239-
RefreshInputManager();
223+
if (GUILayout.Button("Update Input Manager"))
224+
UpdateInputManager();
240225

241-
if (GUILayout.Button("Clear Input Manager Settings"))
226+
if (GUILayout.Button("Clear Input Manager"))
242227
ClearInputManager();
243228

244-
if (GUILayout.Button("Add Default Input Manager Settings"))
245-
AddDefaultInputManager();
229+
if (GUILayout.Button("Revert Default Input Manager Settings"))
230+
RevertDefaultInputManager();
246231
}
247232

248233
/// <summary>
249234
/// Compile the Tool part to Tool inspector.
250235
/// </summary>
251-
private void PartTool()
236+
private void Part_Tool()
252237
{
253-
GUILayout.Label("** Framework / Project **");
238+
GUILayout.Label("Framework / Project", EditorStyles.boldLabel);
254239

255240
/* Project Name */
256241
{
@@ -371,8 +356,8 @@ private static GameObject CreateJCSSettings()
371356
/// Create settings for 3d game combine
372357
/// with JCSUnity.
373358
/// </summary>
374-
[MenuItem("JCSUnity/Input/Add Input Manager depends on target gamepad type", false, 10)]
375-
private static void RefreshInputManager()
359+
[MenuItem("JCSUnity/Input/Update Input Manager", false, 10)]
360+
private static void UpdateInputManager()
376361
{
377362
JCS_InputController.SetupInputManager();
378363
}
@@ -383,8 +368,8 @@ private static void ClearInputManager()
383368
JCS_InputController.ClearInputManagerSettings();
384369
}
385370

386-
[MenuItem("JCSUnity/Input/Add Default Input Manager Settings", false, 10)]
387-
private static void AddDefaultInputManager()
371+
[MenuItem("JCSUnity/Input/Revert Default Input Manager Settings", false, 10)]
372+
private static void RevertDefaultInputManager()
388373
{
389374
JCS_InputController.DefaultInputManagerSettings();
390375
}
@@ -469,18 +454,12 @@ private static void UpdateJCSUnity()
469454

470455
if (upToDate)
471456
{
472-
EditorUtility.DisplayDialog(
473-
title,
474-
"Already up to date.",
475-
"Close");
457+
EditorUtility.DisplayDialog(title, "Already up to date.", "Close");
476458
}
477459
// TODO(jenchieh): not up to date...
478460
else
479461
{
480-
bool option = EditorUtility.DisplayDialog(
481-
title,
482-
"",
483-
"Close");
462+
bool option = EditorUtility.DisplayDialog(title, "", "Close");
484463

485464
if (option)
486465
{
File renamed without changes.

0 commit comments

Comments
 (0)