This repository was archived by the owner on Jul 23, 2022. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 3 files changed +17
-14
lines changed Expand file tree Collapse file tree 3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ Material:
5555        m_Texture : {fileID: 0} 
5656        m_Scale : {x: 1, y: 1} 
5757        m_Offset : {x: 0, y: 0} 
58+     m_Ints : [] 
5859    m_Floats :
5960    - _BumpScale : 1 
6061    - _Cutoff : 0.5 
Original file line number Diff line number Diff line change @@ -34,7 +34,14 @@ public void ReloadBar()
3434		customButton . Clear ( ) ; 
3535		for  ( int  i  =  0 ;  i  <  manager . builtinChips . Length ;  i ++ ) 
3636		{ 
37- 			AddChipButton ( manager . builtinChips [ i ] ) ; 
37+ 			
38+ 			if  ( 
39+ 				manager . builtinChips [ i ] . chipName  ==  "AND"  || 
40+ 				manager . builtinChips [ i ] . chipName  ==  "NOT"  || 
41+ 				MainMenu . advancedChipsEnabled  ==  1 )  { 
42+ 					AddChipButton ( manager . builtinChips [ i ] ) ; 
43+ 			} 
44+ 			
3845		} 
3946		Canvas . ForceUpdateCanvases ( ) ; 
4047	} 
@@ -70,15 +77,7 @@ void AddChipButton (Chip chip) {
7077
7178		// Set button event 
7279		//button.onClick.AddListener (() => manager.SpawnChip (chip)); 
73- 		button . AddListener ( ( )  =>  manager . SpawnChip  ( chip ) ) ; 
74- 
75- 		Debug . Log ( chip . chipName ) ; 
76- 
77- 		if  ( chip . chipName  !=  "AND"  &&  chip . chipName  !=  "NOT" )  { 
78- 			button . transform . gameObject . SetActive ( MainMenu . advancedChipsEnabled ) ; 
79- 		} 
80- 
81- 		
80+ 		button . AddListener ( ( )  =>  manager . SpawnChip  ( chip ) ) ; 		
8281
8382		customButton . Add ( button ) ; 
8483	} 
Original file line number Diff line number Diff line change 55using  UnityEngine ; 
66using  UnityEngine . UI ; 
77
8+ 
89public  class  MainMenu  :  MonoBehaviour  { 
910
1011	public  TMP_InputField  projectNameField ; 
1112	public  Button  confirmProjectButton ; 
1213	public  Toggle  fullscreenToggle ; 
1314	public  Toggle  advancedChips ; 
1415
15- 	public  static bool  advancedChipsEnabled   =   true ; 
16+ 	public  static int  advancedChipsEnabled ; 
1617
1718
1819	void  Awake  ( )  { 
20+ 		advancedChipsEnabled  =  PlayerPrefs . GetInt ( "AdvancedChips" ,  1 ) ; 
1921		fullscreenToggle . onValueChanged . AddListener  ( SetFullScreen ) ; 
20- 		advancedChips . SetIsOnWithoutNotify ( advancedChipsEnabled ) ; 
22+ 		advancedChips . SetIsOnWithoutNotify ( advancedChipsEnabled   ==   1 ) ; 
2123	} 
2224
2325	void  LateUpdate  ( )  { 
@@ -28,8 +30,9 @@ void LateUpdate () {
2830	} 
2931
3032    public  void  SetAdvancedChips ( )  { 
31- 		advancedChipsEnabled  =  advancedChips . isOn ; 
32- 		advancedChips . SetIsOnWithoutNotify ( advancedChipsEnabled ) ; 
33+ 		PlayerPrefs . SetInt ( "AdvancedChips" ,  advancedChips . isOn  ?  1  :  0 ) ; 
34+ 		advancedChipsEnabled  =  PlayerPrefs . GetInt ( "AdvancedChips" ,  1 ) ; 
35+ 		advancedChips . SetIsOnWithoutNotify ( advancedChipsEnabled  ==  1 ) ; 
3336	} 
3437
3538    public  void  StartNewProject  ( )  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments