Esempio n. 1
0
 // Token: 0x06000570 RID: 1392 RVA: 0x0001B198 File Offset: 0x00019398
 public KeyStroke(global::System.Collections.Generic.IEnumerable <global::UnityEngine.KeyCode> strokes)
 {
     global::UnityEngine.KeyCode[] array = new global::UnityEngine.KeyCode[6];
     global::System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(array, fieldof(global::< PrivateImplementationDetails > .56E00AE3E24862A05A678D8C8EBB5D992682FA8C44DE1DE046381F424BF15C1C).FieldHandle);
     this.MODIFIER_LIST = array;
     base..ctor();
     foreach (global::UnityEngine.KeyCode stroke in strokes)
     {
         this.AddStroke(stroke);
     }
     this.Init();
 }
Esempio n. 2
0
        // Token: 0x06000572 RID: 1394 RVA: 0x0001B274 File Offset: 0x00019474
        private void AddStroke(global::UnityEngine.KeyCode stroke)
        {
            bool flag = global::System.Linq.Enumerable.Contains <global::UnityEngine.KeyCode>(this.MODIFIER_LIST, stroke);

            if (flag)
            {
                this.modifiers.Add(stroke);
            }
            else
            {
                this.keys.Add(stroke);
            }
        }
Esempio n. 3
0
        // Token: 0x0600056F RID: 1391 RVA: 0x0001B004 File Offset: 0x00019204
        public KeyStroke(string strokeString)
        {
            global::UnityEngine.KeyCode[] array = new global::UnityEngine.KeyCode[6];
            global::System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(array, fieldof(global::< PrivateImplementationDetails > .56E00AE3E24862A05A678D8C8EBB5D992682FA8C44DE1DE046381F424BF15C1C).FieldHandle);
            this.MODIFIER_LIST = array;
            base..ctor();
            string[] array2 = global::System.Linq.Enumerable.ToArray <string>(global::System.Linq.Enumerable.Select <string, string>(strokeString.ToUpper().Split(new char[]
            {
                '+',
                '-'
            }), (string key) => key.Trim()));
            int i = 0;

            while (i < array2.Length)
            {
                string text  = array2[i];
                string text2 = text;
                string text3 = text2;
                if (text3 == null)
                {
                    goto IL_E8;
                }
                if (!(text3 == "CTRL"))
                {
                    if (!(text3 == "ALT"))
                    {
                        if (!(text3 == "SHIFT"))
                        {
                            goto IL_E8;
                        }
                        this.AddStroke(304);
                    }
                    else
                    {
                        this.AddStroke(308);
                    }
                }
                else
                {
                    this.AddStroke(306);
                }
IL_15B:
                i++;
                continue;
IL_E8:
                try
                {
                    bool flag = global::System.Text.RegularExpressions.Regex.IsMatch(text, "^\\d$");
                    if (flag)
                    {
                        text = "Alpha" + text;
                    }
                    bool flag2 = global::System.Text.RegularExpressions.Regex.IsMatch(text, "^(LEFT|RIGHT|UP|DOWN)$");
                    if (flag2)
                    {
                        text += "ARROW";
                    }
                    this.AddStroke((global::UnityEngine.KeyCode)global::System.Enum.Parse(typeof(global::UnityEngine.KeyCode), text, true));
                }
                catch (global::System.Exception)
                {
                    global::System.Console.WriteLine("FAILED TO PARSE KEY \"{0}\"", text);
                }
                goto IL_15B;
            }
            this.Init();
        }