55using UnityEngine . UI ;
66using UnityEngine . InputSystem ;
77using TMPro ;
8- [ System . Serializable ] // <- これが大事。忘れずに
9- public class andButton {
10- public andButtonList ds4button ;
8+ [ System . Serializable ]
9+ public class AndButton {
10+ public AndButtonList andbutton ;
1111 public Button button ;
12- public andPanelList panel ;
12+ public AndPanelList panel ;
1313}
1414public class ControllerActionsMB : MonoBehaviour
1515{
1616 [ SerializeField ] GameObject uiope ;
17- [ SerializeField ] List < andButton > data ;
17+ [ SerializeField ] List < AndButton > AndData ;
1818 private GameInputs _gameInputs ;
19- private andPanelList nowpanel ;
19+ private AndPanelList nowpanel ;
2020 private bool is_auto ;
2121 private void Awake ( )
2222 {
@@ -55,23 +55,23 @@ void Update()
5555 is_auto = uiope . GetComponent < PanelContoroller > ( ) . getIsAuto ( ) ;
5656 if ( is_auto )
5757 {
58- nowpanel = andPanelList . auto ;
58+ nowpanel = AndPanelList . auto ;
5959 }
6060 else if ( uiope . GetComponent < PanelContoroller > ( ) . getIsChassis ( ) )
6161 {
62- nowpanel = andPanelList . chassis ;
62+ nowpanel = AndPanelList . chassis ;
6363 }
6464 else if ( uiope . GetComponent < PanelContoroller > ( ) . getIsConveyor ( ) )
6565 {
66- nowpanel = andPanelList . conveyor ;
66+ nowpanel = AndPanelList . conveyor ;
6767 }
6868 else if ( uiope . GetComponent < PanelContoroller > ( ) . getIsBoxArm ( ) )
6969 {
70- nowpanel = andPanelList . box_arm ;
70+ nowpanel = AndPanelList . box_arm ;
7171 }
7272 else if ( uiope . GetComponent < PanelContoroller > ( ) . getIsPylonArm ( ) )
7373 {
74- nowpanel = andPanelList . pylon_arm ;
74+ nowpanel = AndPanelList . pylon_arm ;
7575 }
7676 }
7777
@@ -80,44 +80,44 @@ private void OnDestroy()
8080 _gameInputs ? . Dispose ( ) ;
8181 }
8282
83- private void OnMaru ( InputAction . CallbackContext context ) { Osu ( andButtonList . Maru ) ; }
84- private void OnBatu ( InputAction . CallbackContext context ) { Osu ( andButtonList . Batu ) ; }
85- private void OnSikaku ( InputAction . CallbackContext context ) { Osu ( andButtonList . Sikaku ) ; }
86- private void OnSankaku ( InputAction . CallbackContext context ) { Osu ( andButtonList . Sankaku ) ; }
87- private void OnUp ( InputAction . CallbackContext context ) { Osu ( andButtonList . Up ) ; }
88- private void OnDown ( InputAction . CallbackContext context ) { Osu ( andButtonList . Down ) ; }
89- private void OnLeft ( InputAction . CallbackContext context ) { Osu ( andButtonList . Left ) ; }
90- private void OnRight ( InputAction . CallbackContext context ) { Osu ( andButtonList . Right ) ; }
91- private void OnL1 ( InputAction . CallbackContext context ) { Osu ( andButtonList . L1 ) ; }
92- private void OnL2 ( InputAction . CallbackContext context ) { Osu ( andButtonList . L2 ) ; }
93- private void OnR1 ( InputAction . CallbackContext context ) { Osu ( andButtonList . R1 ) ; }
94- private void OnR2 ( InputAction . CallbackContext context ) { Osu ( andButtonList . R2 ) ; }
95- private void OnLo ( InputAction . CallbackContext context ) { Osu ( andButtonList . Lo ) ; }
96- private void OnRo ( InputAction . CallbackContext context ) { Osu ( andButtonList . Ro ) ; }
97- private void OnShare ( InputAction . CallbackContext context ) { Osu ( andButtonList . Share ) ; }
98- private void OnOptions ( InputAction . CallbackContext context ) { Osu ( andButtonList . Options ) ; }
99- private void OnTouchPad ( InputAction . CallbackContext context ) { Osu ( andButtonList . TouchPad ) ; }
100- private void OnY ( InputAction . CallbackContext context ) { Osu ( andButtonList . Y ) ; }
101- private void OnX ( InputAction . CallbackContext context ) { Osu ( andButtonList . X ) ; }
102- private void OnA ( InputAction . CallbackContext context ) { Osu ( andButtonList . A ) ; }
103- private void OnB ( InputAction . CallbackContext context ) { Osu ( andButtonList . B ) ; }
104- private void OnStart ( InputAction . CallbackContext context ) { Osu ( andButtonList . Start ) ; }
105- private void OnSelect ( InputAction . CallbackContext context ) { Osu ( andButtonList . Select ) ; }
106- private void Osu ( andButtonList OsuButton ) {
107- List < andButton > result = data . FindAll ( m => m . ds4button == OsuButton ) ;
83+ private void OnMaru ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Maru ) ; }
84+ private void OnBatu ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Batu ) ; }
85+ private void OnSikaku ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Sikaku ) ; }
86+ private void OnSankaku ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Sankaku ) ; }
87+ private void OnUp ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Up ) ; }
88+ private void OnDown ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Down ) ; }
89+ private void OnLeft ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Left ) ; }
90+ private void OnRight ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Right ) ; }
91+ private void OnL1 ( InputAction . CallbackContext context ) { Osu ( AndButtonList . L1 ) ; }
92+ private void OnL2 ( InputAction . CallbackContext context ) { Osu ( AndButtonList . L2 ) ; }
93+ private void OnR1 ( InputAction . CallbackContext context ) { Osu ( AndButtonList . R1 ) ; }
94+ private void OnR2 ( InputAction . CallbackContext context ) { Osu ( AndButtonList . R2 ) ; }
95+ private void OnLo ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Lo ) ; }
96+ private void OnRo ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Ro ) ; }
97+ private void OnShare ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Share ) ; }
98+ private void OnOptions ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Options ) ; }
99+ private void OnTouchPad ( InputAction . CallbackContext context ) { Osu ( AndButtonList . TouchPad ) ; }
100+ private void OnY ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Y ) ; }
101+ private void OnX ( InputAction . CallbackContext context ) { Osu ( AndButtonList . X ) ; }
102+ private void OnA ( InputAction . CallbackContext context ) { Osu ( AndButtonList . A ) ; }
103+ private void OnB ( InputAction . CallbackContext context ) { Osu ( AndButtonList . B ) ; }
104+ private void OnStart ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Start ) ; }
105+ private void OnSelect ( InputAction . CallbackContext context ) { Osu ( AndButtonList . Select ) ; }
106+ private void Osu ( AndButtonList OsuButton ) {
107+ List < AndButton > result = AndData . FindAll ( m => m . andbutton == OsuButton ) ;
108108 for ( int count = 0 ; count < result . Count ; count ++ ) {
109- if ( result [ count ] . panel == nowpanel || result [ count ] . panel == andPanelList . CMD ) {
110- // Debug.Log("Clicked "+result[count].ds4button .ToString());
109+ if ( result [ count ] . panel == nowpanel || result [ count ] . panel == AndPanelList . CMD ) {
110+ // Debug.Log("Clicked "+result[count].andbutton .ToString());
111111 result [ count ] . button . onClick . Invoke ( ) ;
112112 }
113113 }
114114 }
115115}
116- public enum andButtonList
116+ public enum AndButtonList
117117{
118118 Sikaku , Batu , Maru , Sankaku , L1 , L2 , R1 , R2 , Lo , Ro , Up , Down , Right , Left , Share , Options , TouchPad , X , Y , A , B , Start , Select
119119}
120- public enum andPanelList
120+ public enum AndPanelList
121121{
122122 con , main , CMD , Null , auto , chassis , conveyor , box_arm , pylon_arm
123123}
0 commit comments