/// <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); } } }
private IEnumerator HideCode() { yield return(WaitFor.Seconds(1)); CodeDisplay.SetValueServer("".PadLeft(((string)CodeDisplay.ValueObject).Length, '*')); }
public void Clear() { Nuke.Clear(); CodeDisplay.SetValueServer(""); }