示例#1
0
 /// <summary>
 /// Code input
 /// </summary>
 /// <param name="digit">The single digit to enter</param>
 public void EnterDigit(char digit)
 {
     if (nuke.NukeSlot.IsEmpty)
     {
         this.TryStopCoroutine(ref corHandler);
         this.StartCoroutine(UpdateDisplay("Insert the disk!", "Insert the disk!"), ref corHandler);
         return;
     }
     if (Nuke.AppendKey(digit))
     {
         if (!Nuke.IsCodeRight)
         {
             int length = Nuke.CurrentCode.Length;
             //replace older digits with asterisks
             string newDigit = Nuke.CurrentCode.Substring(length <= 0 ? 0 : length - 1);
             CodeDisplay.SetValueServer(newDigit.PadLeft(length, '*'));
             StartCoroutine(HideCode());
         }
         else
         {
             CodeDisplay.SetValueServer(Nuke.CurrentCode);
         }
     }
 }
示例#2
0
    private IEnumerator HideCode()
    {
        yield return(WaitFor.Seconds(1));

        CodeDisplay.SetValueServer("".PadLeft(((string)CodeDisplay.ValueObject).Length, '*'));
    }
示例#3
0
 public void Clear()
 {
     Nuke.Clear();
     CodeDisplay.SetValueServer("");
 }