public void SelectButton(Mobile_Toy_Button button, bool set) { if (selected_button != null) { selected_button.SetSelectedToy(false); } if (button != null) { button.SetSelectedToy(set); } if (set) { selected_button = button; Monitor.Instance.InitMainSignal(button.label.runetype, button.label.toytype); selected_button_image.gameObject.SetActive(true); selected_button_image.SetParent(selected_button.transform); RectTransform set_me_to = selected_button.my_button.image.GetComponent <RectTransform>(); selected_button_image.anchoredPosition = set_me_to.anchoredPosition; selected_button_image.localScale = set_me_to.localScale; setSelectedIslandImage(button.label.runetype, button.label.toytype); Noisemaker.Instance.Click(ClickType.Success); } else { selected_button_image.gameObject.SetActive(false); setSelectedIslandImage(RuneType.Null, ToyType.Null); } }
public void ResetSelected() { // Debug.Log("Resetting selected\n"); selected_button = null; Peripheral.Instance.SelectToy("", RuneType.Null, false); Monitor.Instance.InitMainSignal(RuneType.Null, ToyType.Null); foreach (MyLabel l in my_panel.list) { l.ui_button.SetSelectedToy(false); l.SetHidden(false); } selected_button_image.gameObject.SetActive(false); selected_island_image.sprite = TowerStore.getPreviewSprite(RuneType.Null, ToyType.Null); selected_button_image.gameObject.SetActive(false); }