예제 #1
0
 public override void Update()
 {
     if (canType)
     {
         string input = Input.inputString;
         input = Regex.Replace(input, @"[^a-zA-Z\b\r]", "");
         for (int c = 0; c < input.Length; c++)
         {
             if (input[c] == '\b')
             {
                 if (currentPasswordSize > 0)
                 {
                     passwordBuilder.Remove(passwordBuilder.Length - 1, 1);
                     bomb.ErasePasswordCharacter();
                     currentPasswordSize--;
                 }
             }
             else if (input[c] == '\r')
             {
                 bomb.Submit(passwordBuilder.ToString());
                 currentPasswordSize = 0;
                 passwordBuilder.Remove(0, passwordBuilder.Length);
                 canType = false;
             }
             else if (currentPasswordSize < passwordSize)
             {
                 passwordBuilder.Append(input[c]);
                 bomb.AddPasswordCharacter(input[c]);
                 currentPasswordSize++;
             }
         }
     }
 }