public void Record(Button button, MainScene main) { Button recordButton = null; foreach (var item in main.Buttons) { if (item.gameObject.name == buttonName) { recordButton = item; } } if (recordButton == button) { return; } else { if (recordButton != null) { recordButton.targetGraphic.color *= 2f; } } buttonName = button.gameObject.name; button.targetGraphic.color *= 0.5f; }
public void Recover(MainScene main) { Button recordButton = null; foreach (var item in main.Buttons) { if (item.gameObject.name == buttonName) { recordButton = item; } } if (recordButton != null) { recordButton.targetGraphic.color *= 0.5f; recordButton.onClick.Invoke(); } }