当前位置: 首页>>代码示例>>C#>>正文


C# ISettingsManager.ApplySettings方法代码示例

本文整理汇总了C#中ISettingsManager.ApplySettings方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsManager.ApplySettings方法的具体用法?C# ISettingsManager.ApplySettings怎么用?C# ISettingsManager.ApplySettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISettingsManager的用法示例。


在下文中一共展示了ISettingsManager.ApplySettings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetDefaults

        private void SetDefaults(ISettingsManager settingsManager)
        {
            var keybindings = new List<Wren.Core.Input.KeyboardBindingSettings.KeyBinding>();
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 0, Key = "UpArrow" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 1, Key = "DownArrow" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 2, Key = "LeftArrow" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 3, Key = "RightArrow" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 4, Key = "X" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 5, Key = "Z" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 6, Key = "C" });
            keybindings.Add(new KeyboardBindingSettings.KeyBinding() { ButtonId = 7, Key = "V" });
            var defaultKeybindings = new KeyboardBindingSettings() { Bindings = keybindings.ToArray() };
            settingsManager.ApplySettings(defaultKeybindings);

            var gamepadbindings1 = new List<Wren.Core.Input.GamepadBindingSettings.GamepadBinding>();
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 0, Button = -1 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 1, Button = -2 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 2, Button = -3 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 3, Button = -4 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 4, Button = 1 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 5, Button = 0 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 6, Button = 6 });
            gamepadbindings1.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 7, Button = 7 });

            var gamepadbindings2 = new List<Wren.Core.Input.GamepadBindingSettings.GamepadBinding>();
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 8, Button = -1 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 9, Button = -2 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 10, Button = -3 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 11, Button = -4 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 12, Button = 1 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 13, Button = 0 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 14, Button = 6 });
            gamepadbindings2.Add(new Wren.Core.Input.GamepadBindingSettings.GamepadBinding() { ButtonId = 15, Button = 7 });

            var defaultGamepadBindings = new GamepadBindingSettings() { Gamepad1Bindings = gamepadbindings1.ToArray(), Gamepad2Bindings = gamepadbindings2.ToArray() };
            settingsManager.ApplySettings(defaultGamepadBindings);
        }
开发者ID:PhilipBrockmeyer,项目名称:Wren,代码行数:37,代码来源:InputModule.cs


注:本文中的ISettingsManager.ApplySettings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。