// Update is called once per frame void Update() { if (CurrentIndex == DataManager.GetSaveLoadIndex()) { return; } CurrentIndex = DataManager.GetSaveLoadIndex(); switch (CurrentIndex) { case 1: gameObject.GetComponent <Image>().sprite = SaveImage; break; case 2: gameObject.GetComponent <Image>().sprite = LoadImage; break; case 3: gameObject.GetComponent <Image>().sprite = QLoadImage; break; } }
// Update is called once per frame void Update() { if (DataPanel1.gameObject.activeInHierarchy) { if (DataManager.GetSaveLoadIndex() == 4) { Button1.gameObject.SetActive(false); Button2.gameObject.SetActive(false); Button3.gameObject.SetActive(false); Button4.gameObject.SetActive(false); Button5.gameObject.SetActive(false); Button6.gameObject.SetActive(false); Button7.gameObject.SetActive(false); Button8.gameObject.SetActive(false); Button9.gameObject.SetActive(false); Button10.gameObject.SetActive(false); Button11.gameObject.SetActive(false); Button12.gameObject.SetActive(false); Field1.colors = SelectableColor; Field2.colors = SelectableColor; Field3.colors = SelectableColor; Field4.colors = SelectableColor; Field5.colors = SelectableColor; Field6.colors = SelectableColor; Field7.colors = SelectableColor; Field8.colors = SelectableColor; Field9.colors = SelectableColor; Field10.colors = SelectableColor; Field11.colors = SelectableColor; Field12.colors = SelectableColor; } } if (DataManager.GetSaveLoadIndex() != 4) { Button1.gameObject.SetActive(true); Button2.gameObject.SetActive(true); Button3.gameObject.SetActive(true); Button4.gameObject.SetActive(true); Button5.gameObject.SetActive(true); Button6.gameObject.SetActive(true); Button7.gameObject.SetActive(true); Button8.gameObject.SetActive(true); Button9.gameObject.SetActive(true); Button10.gameObject.SetActive(true); Button11.gameObject.SetActive(true); Button12.gameObject.SetActive(true); Field1.colors = NormalColor; Field2.colors = NormalColor; Field3.colors = NormalColor; Field4.colors = NormalColor; Field5.colors = NormalColor; Field6.colors = NormalColor; Field7.colors = NormalColor; Field8.colors = NormalColor; Field9.colors = NormalColor; Field10.colors = NormalColor; Field11.colors = NormalColor; Field12.colors = NormalColor; } }