@@ -9,13 +9,12 @@ namespace QuickSwitchCombination
99 internal class Menu : MonoBehaviour
1010 {
1111 internal static AssetBundle ab { get ; set ; }
12+ internal static bool ShowMenu { get ; set ; } = false ;
1213
1314 public Menu ( IntPtr intPtr ) : base ( intPtr )
1415 {
1516 }
1617
17- public static bool ShowMenu = false ;
18-
1918 private void Start ( )
2019 {
2120 if ( ab == null )
@@ -72,29 +71,32 @@ private static void SetMenu()
7271 ClassInjector . RegisterTypeInIl2Cpp < Plus > ( ) ;
7372 ConstantVariables . Plus . AddComponent < Plus > ( ) ;
7473
75- SetCombination ( ) ;
74+ for ( int i = 0 ; i < Save . Settings . datas . Count ; i ++ )
75+ {
76+ SetCombination ( i ) ;
77+ }
7678 }
7779
78- internal static void SetCombination ( )
80+ internal static void SetCombination ( int count )
7981 {
80- for ( int i = 0 ; i < Save . Settings . datas . Count ; i ++ )
81- {
82- var combination = Instantiate ( ab . LoadAsset ( "Assets/Combination.prefab" ) . Cast < GameObject > ( ) , ConstantVariables . ContentTransform ) ;
82+ var combination = Instantiate ( ab . LoadAsset ( "Assets/Combination.prefab" ) . Cast < GameObject > ( ) , ConstantVariables . ContentTransform ) ;
8383
84- ClassInjector . RegisterTypeInIl2Cpp < Count > ( ) ;
85- combination . AddComponent < Count > ( ) ;
86- combination . GetComponent < Count > ( ) . count = i ;
84+ ClassInjector . RegisterTypeInIl2Cpp < Count > ( ) ;
85+ combination . AddComponent < Count > ( ) ;
86+ combination . GetComponent < Count > ( ) . count = count ;
8787
88- ClassInjector . RegisterTypeInIl2Cpp < Character > ( ) ;
89- combination . transform . GetChild ( 0 ) . gameObject . AddComponent < Character > ( ) ;
88+ ClassInjector . RegisterTypeInIl2Cpp < Character > ( ) ;
89+ combination . transform . GetChild ( 0 ) . gameObject . AddComponent < Character > ( ) ;
9090
91- ClassInjector . RegisterTypeInIl2Cpp < Elfin > ( ) ;
92- combination . transform . GetChild ( 1 ) . gameObject . AddComponent < Elfin > ( ) ;
91+ ClassInjector . RegisterTypeInIl2Cpp < Elfin > ( ) ;
92+ combination . transform . GetChild ( 1 ) . gameObject . AddComponent < Elfin > ( ) ;
9393
94- ClassInjector . RegisterTypeInIl2Cpp < Key > ( ) ;
95- combination . transform . GetChild ( 2 ) . gameObject . AddComponent < Key > ( ) ;
96- combination . transform . GetChild ( 2 ) . GetChild ( 0 ) . gameObject . GetComponent < Text > ( ) . text = Save . Settings . datas [ i ] . Key . ToString ( ) ;
97- }
94+ ClassInjector . RegisterTypeInIl2Cpp < Key > ( ) ;
95+ combination . transform . GetChild ( 2 ) . gameObject . AddComponent < Key > ( ) ;
96+ combination . transform . GetChild ( 2 ) . GetChild ( 0 ) . gameObject . GetComponent < Text > ( ) . text = Save . Settings . datas [ count ] . Key . ToString ( ) ;
97+
98+ ClassInjector . RegisterTypeInIl2Cpp < Select > ( ) ;
99+ combination . transform . GetChild ( 3 ) . gameObject . AddComponent < Select > ( ) ;
98100 }
99101 }
100102}
0 commit comments