public void Register(PlayerControllerButton button) { if (button.GetType().ToString() == "DesignPattern.Mediator.StartButton") { _startButton = button as StartButton; } else if (button.GetType().ToString() == "DesignPattern.Mediator.StopButton") { _stopButton = button as StopButton; } else if (button.GetType().ToString() == "DesignPattern.Mediator.PauseButton") { _pauseButton = button as PauseButton; } }
public void ClickButton(PlayerControllerButton button) { if (button == _startButton) { _startButton.Enable = true; _stopButton.Enable = false; _pauseButton.Enable = false; } else if (button == _stopButton) { _startButton.Enable = false; _stopButton.Enable = true; _pauseButton.Enable = false; } else if (button == _pauseButton) { _startButton.Enable = false; _stopButton.Enable = false; _pauseButton.Enable = true; } }