public static void Update()
        {
            XInputPad device = Input.GetDevice <XInputPad>();

            if ((double)Shredder._noteWait <= 0.0)
            {
                if (device.MapDown(16384, false))
                {
                    Shredder._currentNote = Shredder.GetNextNote(Shredder._currentNote, Shredder._basicScale);
                    SFX.Play("guitar/guitar-" + Change.ToString((object)Shredder._currentNote));
                    Shredder._noteWait = 1f;
                }
                if (device.MapDown(32768, false))
                {
                    Shredder._currentNote = Shredder._currentNote = (int)Shredder._basicScale[0];
                    SFX.Play("guitar/guitar-" + Change.ToString((object)Shredder._currentNote));
                    Shredder._noteWait = 1f;
                }
                if (device.MapDown(8192, false))
                {
                    Shredder._currentNote = Shredder.GetPrevNote(Shredder._currentNote, Shredder._basicScale);
                    SFX.Play("guitar/guitar-" + Change.ToString((object)Shredder._currentNote));
                    Shredder._noteWait = 1f;
                }
            }
            Shredder._noteWait -= 0.15f;
        }
示例#2
0
        public void SwitchPlayerProfile()
        {
            this.inputTypes.Clear();
            this.inputMaps.Clear();
            for (int index = 0; index < 4; ++index)
            {
                XInputPad device = Input.GetDevice <XInputPad>(index);
                if (device != null && device.isConnected)
                {
                    this.inputTypes.Add("XBOX GAMEPAD");
                    this.inputMaps.Add(Input.GetDefaultMapping(device.productName, device.productGUID).Clone());
                    break;
                }
            }
            List <string> stringList = new List <string>();

            for (int index = 0; index < 8; ++index)
            {
                if (DInput.GetState(index) != null)
                {
                    string productName = DInput.GetProductName(index);
                    string productGuid = DInput.GetProductGUID(index);
                    string str         = productName + productGuid;
                    if (!stringList.Contains(str))
                    {
                        stringList.Add(str);
                        this.inputMaps.Add(Input.GetDefaultMapping(productName, productGuid).Clone());
                        if (productName.Length > 24)
                        {
                            productName = productName.Substring(0, 24);
                        }
                        this.inputTypes.Add(productName);
                    }
                }
            }
            this.inputTypes.Add("KEYBOARD P1");
            this.inputMaps.Add(Input.GetDefaultMapping("KEYBOARD P1", "").Clone());
            this.inputTypes.Add("KEYBOARD P2");
            this.inputMaps.Add(Input.GetDefaultMapping("KEYBOARD P2", "").Clone());
            this.inputConfigType = 0;
            this.SwitchConfigType();
        }