|  |  |  | @ -12,11 +12,14 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     int idx = 0; | 
			
		
	
		
			
				
					|  |  |  |  |     int nextChangeTime = 0; | 
			
		
	
		
			
				
					|  |  |  |  |     bool updatedConfig = false; | 
			
		
	
		
			
				
					|  |  |  |  |     bool writeConfigInside = false; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     void Start() | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |          | 
			
		
	
		
			
				
					|  |  |  |  |         FileUtil.WatchFile(Application.streamingAssetsPath, | 
			
		
	
		
			
				
					|  |  |  |  |             "config.ini", new FileSystemEventHandler(OnIniChanged)); | 
			
		
	
		
			
				
					|  |  |  |  |         Config.LoadConfigFromIni(); | 
			
		
	
		
			
				
					|  |  |  |  |         SetConfig(); | 
			
		
	
		
			
				
					|  |  |  |  |         Config.LoadCardsInDir(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -24,23 +27,40 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  |         LoadCard(Config.cardPath); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     private void OnIniChanged(object sender, FileSystemEventArgs e) | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |          | 
			
		
	
		
			
				
					|  |  |  |  |         if (e.ChangeType != WatcherChangeTypes.Changed) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         if (writeConfigInside) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             writeConfigInside = false; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         else | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             Debug.Log("Ini changed"); | 
			
		
	
		
			
				
					|  |  |  |  |             updatedConfig = true; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     void SetConfig() | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |         if (Config.fullscreen == 1) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             Screen.SetResolution(7680, 4320, true);  | 
			
		
	
		
			
				
					|  |  |  |  |             Screen.SetResolution(7680, 4320, true); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         else | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             Screen.SetResolution(1280, 720, false); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (Config.cardPath == "" || Config.cardPath == "null") | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             Config.cardPath = FileUtil.OpenFile(); | 
			
		
	
		
			
				
					|  |  |  |  |             Config.SaveConfigToIni(); | 
			
		
	
		
			
				
					|  |  |  |  |             writeConfigInside = true; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         Camera camera = GetComponent<Camera>(); | 
			
		
	
		
			
				
					|  |  |  |  |         camera.orthographicSize = Config.cameraSize; | 
			
		
	
		
			
				
					|  |  |  |  |         camera.transform.position =  | 
			
		
	
	
		
			
				
					|  |  |  | @ -59,6 +79,7 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         Config.cardPath = cardPath; | 
			
		
	
		
			
				
					|  |  |  |  |         Config.SaveConfigToIni(); | 
			
		
	
		
			
				
					|  |  |  |  |         writeConfigInside = true; | 
			
		
	
		
			
				
					|  |  |  |  |         nextChangeTime = (int)Time.time + Config.changeTime; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  |  | @ -76,6 +97,16 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     void Update() | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |         if (updatedConfig) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             Config.LoadConfigFromIni(); | 
			
		
	
		
			
				
					|  |  |  |  |             SetConfig(); | 
			
		
	
		
			
				
					|  |  |  |  |             Config.LoadCardsInDir(); | 
			
		
	
		
			
				
					|  |  |  |  |             this.InitIdx(); | 
			
		
	
		
			
				
					|  |  |  |  |             this.LoadCard(Config.cardPath); | 
			
		
	
		
			
				
					|  |  |  |  |             updatedConfig = false; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (Config.autoChange == 1 && Time.time >= nextChangeTime && cntCard) | 
			
		
	
		
			
				
					|  |  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |  |             LoadNextCard(); | 
			
		
	
	
		
			
				
					|  |  |  | @ -87,6 +118,7 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |         Config.cameraY += 0.1f; | 
			
		
	
		
			
				
					|  |  |  |  |         Config.SaveConfigToIni(); | 
			
		
	
		
			
				
					|  |  |  |  |         writeConfigInside = true; | 
			
		
	
		
			
				
					|  |  |  |  |         Camera camera = GetComponent<Camera>(); | 
			
		
	
		
			
				
					|  |  |  |  |         Vector3 vec = camera.transform.position; | 
			
		
	
		
			
				
					|  |  |  |  |         vec.y = Config.cameraY; | 
			
		
	
	
		
			
				
					|  |  |  | @ -98,6 +130,7 @@ public class Card : MonoBehaviour | 
			
		
	
		
			
				
					|  |  |  |  |     { | 
			
		
	
		
			
				
					|  |  |  |  |         Config.cameraY -= 0.1f; | 
			
		
	
		
			
				
					|  |  |  |  |         Config.SaveConfigToIni(); | 
			
		
	
		
			
				
					|  |  |  |  |         writeConfigInside = true; | 
			
		
	
		
			
				
					|  |  |  |  |         Camera camera = GetComponent<Camera>(); | 
			
		
	
		
			
				
					|  |  |  |  |         Vector3 vec = camera.transform.position; | 
			
		
	
		
			
				
					|  |  |  |  |         vec.y = Config.cameraY; | 
			
		
	
	
		
			
				
					|  |  |  | 
 |