Skip to content

Commit 90f20ae

Browse files
committed
Fix Editor naming
1 parent 0a8ed8b commit 90f20ae

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

Assets/JCSUnity/Scripts/Input/JCS_InputController.cs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ namespace JCSUnity
2222
public class JCS_InputController
2323
: MonoBehaviour
2424
{
25+
public static int GAME_PAD_COUNT = 0; // How many gampad in this game?
26+
27+
public static int SelectGamepadType = 0;
28+
public static string[] GamepadPlatform = {
29+
"Select Platform",
30+
31+
/* Sony Play Station */
32+
"PS",
33+
"PS2",
34+
"PS3",
35+
"PS4",
36+
37+
/* Microsoft XBox */
38+
"XBox",
39+
"XBox 360",
40+
"XBox One",
41+
};
42+
2543
/// <summary>
2644
/// Get the serialize property from Unity's 'InputManager'
2745
/// element structure.
@@ -147,10 +165,7 @@ public static void ClearInputManagerSettings()
147165
/// </summary>
148166
public static void SetupInputManager()
149167
{
150-
// Add gamepad definitions
151-
JCSUnity_EditorWindow jcsunity_ew = JCSUnity_EditorWindow.instance;
152-
153-
switch (jcsunity_ew.SelectGamepadType)
168+
switch (SelectGamepadType)
154169
{
155170
case 0: /* ==> Select Platform <== */
156171

@@ -542,13 +557,11 @@ public static void DefaultInputManagerSettings()
542557
/// </summary>
543558
public static void SetupPS4Joystick()
544559
{
545-
int gamePadCount = JCSUnity_EditorWindow.instance.GAME_PAD_COUNT;
546-
547560
float defalutSenstivity = JCS_InputSettings.DEFAULT_SENSITIVITY;
548561
float defaultDead = JCS_InputSettings.DEFAULT_DEAD;
549562
float defaultGravity = JCS_InputSettings.DEFAULT_GRAVITY;
550563

551-
for (int joystickNum = 0; joystickNum < gamePadCount; ++joystickNum)
564+
for (int joystickNum = 0; joystickNum < GAME_PAD_COUNT; ++joystickNum)
552565
{
553566
foreach (JCS_JoystickButton val in JCS_Utility.GetValues<JCS_JoystickButton>())
554567
{
@@ -577,13 +590,11 @@ public static void SetupPS4Joystick()
577590
/// </summary>
578591
public static void SetupXBox360Joystick()
579592
{
580-
int gamePadCount = JCSUnity_EditorWindow.instance.GAME_PAD_COUNT;
581-
582593
float defalutSenstivity = JCS_InputSettings.DEFAULT_SENSITIVITY;
583594
float defaultDead = JCS_InputSettings.DEFAULT_DEAD;
584595
float defaultGravity = JCS_InputSettings.DEFAULT_GRAVITY;
585596

586-
for (int joystickNum = 0; joystickNum < gamePadCount; ++joystickNum)
597+
for (int joystickNum = 0; joystickNum < GAME_PAD_COUNT; ++joystickNum)
587598
{
588599
foreach (JCS_JoystickButton val in JCS_Utility.GetValues<JCS_JoystickButton>())
589600
{

Assets/JCSUnity/Scripts/Settings/JCS_InputSettings.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@ public static string GetPositiveNameByLabel(JCS_JoystickButton label)
331331
#if (UNITY_EDITOR)
332332
if (instance == null)
333333
{
334-
JCSUnity_EditorWindow jcsunity_ew = JCSUnity_EditorWindow.instance;
335-
336-
switch (jcsunity_ew.SelectGamepadType)
334+
switch (JCS_InputController.SelectGamepadType)
337335
{
338336
case 0: /* ==> Select Platform <== */
339337
return "";
@@ -398,9 +396,7 @@ public static string GetPositiveNameByLabel(JCS_JoystickButton label)
398396
/// <returns></returns>
399397
public static bool IsInvert(JCS_JoystickButton label)
400398
{
401-
JCSUnity_EditorWindow jcsunity_ew = JCSUnity_EditorWindow.instance;
402-
403-
switch (jcsunity_ew.SelectGamepadType)
399+
switch (JCS_InputController.SelectGamepadType)
404400
{
405401
case 0: /* ==> Select Platform <== */
406402
return false;
@@ -448,9 +444,7 @@ public static bool IsInvert(JCS_JoystickButton label)
448444
/// <returns></returns>
449445
public static JCS_AxisChannel GetAxisChannel(JCS_JoystickButton label)
450446
{
451-
JCSUnity_EditorWindow jcsunity_ew = JCSUnity_EditorWindow.instance;
452-
453-
switch (jcsunity_ew.SelectGamepadType)
447+
switch (JCS_InputController.SelectGamepadType)
454448
{
455449
case 0: /* ==> Select Platform <== */
456450
break;
@@ -532,9 +526,7 @@ public static JCS_AxisChannel GetAxisChannel(JCS_JoystickButton label)
532526
/// <returns></returns>
533527
public static JCS_AxisType GetAxisType(JCS_JoystickButton label)
534528
{
535-
JCSUnity_EditorWindow jcsunity_ew = JCSUnity_EditorWindow.instance;
536-
537-
switch (jcsunity_ew.SelectGamepadType)
529+
switch (JCS_InputController.SelectGamepadType)
538530
{
539531
case 0: /* ==> Select Platform <== */
540532
break;

0 commit comments

Comments
 (0)