@@ -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 {
0 commit comments