예제 #1
0
 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;
     }
 }
예제 #2
0
 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;
     }
 }