示例#1
0
 /// <summary>
 /// "Open" or "Close" the this window by sounds
 /// </summary>
 public void openClose(SoundBox openSound, SoundBox closeSound)
 {
     switch (state)
     {
         case doorState.Closed: { state = doorState.Opening; openSound.playSound(); }
             break;
         case doorState.Closing: state = doorState.Closing;
             break;
         case doorState.Opened: { state = doorState.Closing; closeSound.playSound(); }
             break;
         case doorState.Opening: state = doorState.Opening;
             break;
     }
 }