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


C# ControllerType类代码示例

本文整理汇总了C#中ControllerType的典型用法代码示例。如果您正苦于以下问题:C# ControllerType类的具体用法?C# ControllerType怎么用?C# ControllerType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: SaveControllerData

 /// <summary>
 /// Save all data for a specific controller. Does not save Player data.
 /// </summary>
 /// <param name="controllerType">Controller type</param>
 /// <param name="controllerId">Controller id</param>
 public override void SaveControllerData(ControllerType controllerType, int controllerId) {
     if(!isEnabled) {
         Debug.LogWarning("UserDataStore_PlayerPrefs is disabled and will not save any data.", this);
         return;
     }
     SaveControllerDataNow(controllerType, controllerId);
 }
开发者ID:MaturuturuStudios,项目名称:Drop,代码行数:12,代码来源:UserDataStore_PlayerPrefs.cs

示例2: GameSettings

 // Construct new GameSettings instance using values loaded from file
 public GameSettings(XElement data)
 {
     _screenWidth = Loader.loadInt(data.Element("ScreenWidth"), 800);
     _screenHeight = Loader.loadInt(data.Element("ScreenHeight"), 600);
     _fullscreen = Loader.loadBool(data.Element("Fullscreen"), false);
     _controllerType = (ControllerType)Loader.loadEnum(typeof(ControllerType), data.Element("ControllerType"), (int)ControllerType.KeyboardAndMouse);
 }
开发者ID:klutch,项目名称:StasisEngine,代码行数:8,代码来源:GameSettings.cs

示例3:

 Boolean IInputManager.actionTapped(InputAction action)
 {
     if(keyInput.actionTapped(action))
     {
         lastControllerTapped = ControllerType.Keyboard;
         return true;
     }
     if(padOneInput.actionTapped(action))
     {
         lastControllerTapped = ControllerType.PadOne;
         return true;
     }
     if(padTwoInput.actionTapped(action))
     {
         lastControllerTapped = ControllerType.PadTwo;
         return true;
     }
     if(padThreeInput.actionTapped(action))
     {
         lastControllerTapped = ControllerType.PadThree;
         return true;
     }
     if(padFourInput.actionTapped(action))
     {
         lastControllerTapped = ControllerType.PadFour;
         return true;
     }
     return false;
 }
开发者ID:Jamedjo,项目名称:BeatShift,代码行数:29,代码来源:AnyInputManager.cs

示例4: controller_types_are_mapped_correctly_in_collection

 public void controller_types_are_mapped_correctly_in_collection(Type type, ControllerType controllerType)
 {
     _sut.Collection
         .Single(x => x.Name == type.FullName)
         .ControllerType
         .ShouldEqual(controllerType);
 }
开发者ID:gitter-badger,项目名称:Sitecore.Glimpse,代码行数:7,代码来源:ControllersBehaviour.cs

示例5: SetControllerType

 public void SetControllerType(string type)
 {
     if (type == "local") {
         controllerType = ControllerType.Local;
     } else {
         controllerType = ControllerType.Remote;
     }
 }
开发者ID:tiger0-0,项目名称:gamemachine,代码行数:8,代码来源:GameEntityInput.cs

示例6: AddPlayer

 public void AddPlayer(int number, PlayerIndex playerIndex, ControllerType controllerType)
 {
     Debug.Log("Add player : " + number + ", controller: " + playerIndex);
     players.Add(new PlayerList(number, playerIndex, controllerType));
     
     uiPlayers[number-1].sprite = GameManager.instance.playerSkins[number-1].ui;
     UIManager.instance.Shake(50f, 10f, Vector2.zero);
 }
开发者ID:ogilquin,项目名称:bastard-and-ritual,代码行数:8,代码来源:PlayerSelectManager.cs

示例7: LoadControllerData

 public override void LoadControllerData(int playerId, ControllerType controllerType, int controllerId)
 {
     if (!this.isEnabled)
     {
         Debug.LogWarning("UserDataStore_PlayerPrefs is disabled and will not load any data.", this);
         return;
     }
     this.LoadControllerDataNow(playerId, controllerType, controllerId);
 }
开发者ID:GameDiffs,项目名称:TheForest,代码行数:9,代码来源:UserDataStore_PlayerPrefs.cs

示例8: selectType

 public static void selectType(ControllerType type)
 {
     if (type == ControllerType.GAMEPAD)
     {
         instance = new KeyboardControl();
     }
     else if (type == ControllerType.KEYBOARD)
     {
         instance = new GamepadControl();
     }
 }
开发者ID:AliMohsen,项目名称:untitled-game,代码行数:11,代码来源:Control.cs

示例9: SaveControllerData

        /// <summary>
        /// Save all data for a specific controller. Does not save Player data.
        /// </summary>
        /// <param name="controllerType">Controller type</param>
        /// <param name="controllerId">Controller id</param>
        public override void SaveControllerData(ControllerType controllerType, int controllerId) {
            if(!isEnabled) {
                Debug.LogWarning(thisScriptName + " is disabled and will not save any data.", this);
                return;
            }
            SaveControllerDataNow(controllerType, controllerId);

#if UNITY_EDITOR
            Debug.Log("Rewired: " + thisScriptName + " saved " + controllerType + " " + controllerId + " data to XML.");
#endif
        }
开发者ID:DrSkipper,项目名称:ScrapyardComrades,代码行数:16,代码来源:UserDataStore_PlayerPrefs.cs

示例10: Controller

        public Controller(string name, ControllerType controllerType, string definition, Csrf csrfProtection, bool authorise)
        {
            if (name == null) throw new ArgumentNullException("name");
            if (definition == null) throw new ArgumentNullException("definition");

            Name = name;
            ControllerType = controllerType;
            Definition = definition;
            CsrfProtection = csrfProtection;
            Authorise = authorise;
        }
开发者ID:gitter-badger,项目名称:Sitecore.Glimpse,代码行数:11,代码来源:Controller.cs

示例11: Keybind

 public Keybind(Keybinds keys, ControllerType portOne, ControllerType portTwo, ControllerType expansion, bool fourScore, bool filterIllegalInput, string inputMode)
 {
     this.keys = keys;
     this.fourScore = fourScore;
     this.portOne = portOne;
     this.portTwo = portTwo;
     this.expansion = expansion;
     this.inputMode = inputMode;
     InitializeComponent();
     chkFourScore.Checked = fourScore;
     chkFilter.Checked = filterIllegalInput;
     switch (portOne)
     {
         case ControllerType.Controller:
             cboPortOne.SelectedIndex = 0;
             break;
         case ControllerType.Zapper:
             cboPortOne.SelectedIndex = 1;
             break;
         case ControllerType.Paddle:
             cboPortOne.SelectedIndex = 2;
             break;
         default:
         case ControllerType.Empty:
             cboPortOne.SelectedIndex = 3;
             break;
     }
     switch (portTwo)
     {
         case ControllerType.Controller:
             cboPortTwo.SelectedIndex = 0;
             break;
         case ControllerType.Zapper:
             cboPortTwo.SelectedIndex = 1;
             break;
         case ControllerType.Paddle:
             cboPortTwo.SelectedIndex = 2;
             break;
         default:
         case ControllerType.Empty:
             cboPortTwo.SelectedIndex = 3;
             break;
     }
     switch (expansion)
     {
         case ControllerType.FamiPaddle:
             cboExpansion.SelectedIndex = 0;
             break;
         default:
         case ControllerType.Empty:
             cboExpansion.SelectedIndex = 1;
             break;
     }
 }
开发者ID:nickmass,项目名称:Emu-o-Tron,代码行数:54,代码来源:Keybind.cs

示例12: ResetData

        /// <inheritdoc/>
        public override void ResetData()
        {
            m_initialized = false;
            m_type = ControllerType.None;
            m_rawValue = 0;
            m_value = 0.0;
            m_periodScale = 0;
            m_zeroLatch = false;

            base.ResetData();
        }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:12,代码来源:PWMData.cs

示例13: createController

 public AAngularController createController(ControllerType controllerType)
 {
     switch (controllerType)
     {
         case ControllerType.NoHttp:
             return new AngularController(angularView);
         case ControllerType.GetHttp:
             return new AngularController(angularView);
         default:
             return new AngularController(angularView);
     }
 }
开发者ID:JaseKirby,项目名称:BootstrapGenerator,代码行数:12,代码来源:ControllerFactory.cs

示例14: GetInputDirection

        /// <summary>
        /// Get input for local player controller
        /// </summary>
        /// <returns>Raw input direction</returns>
        Vector3 GetInputDirection(ControllerType controller = ControllerType.Keyboard)
        {

            Vector3 inputDirection = Vector3.zero;

            switch (controller)
            {
                case ControllerType.Keyboard:

                    // keyboard
                    bool inputRegistered = false;

                    if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.Q))
                    {
                        inputRegistered = true;
                        inputDirection += Vector3.left;
                    }
                    if (Input.GetKey(KeyCode.D))
                    {
                        inputRegistered = true;
                        inputDirection += Vector3.right;
                    }
                    if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.Z))
                    {
                        inputRegistered = true;
                        inputDirection += Vector3.forward;
                    }
                    if (Input.GetKey(KeyCode.S))
                    {
                        inputRegistered = true;
                        inputDirection += Vector3.back;
                    }

                    if (inputRegistered)
                        inputDirection.Normalize();

                    break;
                case ControllerType.Gamepad:
                    Debug.LogWarning("Controller: Assigned to gamepad but no code has been written.");
                    break;
                case ControllerType.SteamController:
                    Debug.LogWarning("Controller: Assigned to SteamController but no code has been written.");
                    break;
                default:
                    break;
            }
            // controller

            return inputDirection;
        }
开发者ID:McBuff,项目名称:DMV,代码行数:54,代码来源:Player_Movement.cs

示例15: InputManager

        /// <summary>
        /// Constructor
        /// </summary>
        private InputManager()
        {
            if (GamePad.GetState(PlayerIndex.One).IsConnected)
            {
                controllerType = ControllerType.GamePad;
                gamePadMapping = new Dictionary<string, Buttons[]>();
            }
            else
            {
                controllerType = ControllerType.Keyboard;
                keyboardMapping = new Dictionary<string, Keys[]>();
            }

            #region Button Mappings

            // Assign the various actions to the mapping dictionaries
            // ex: gamePadMapping.Add("MenuSelection", new Buttons[2] {Buttons.A, Buttons.Start});
            switch (controllerType)
            {
                case ControllerType.GamePad:

                    gamePadMapping.Add("MenuSelection", new Buttons[2] { Buttons.A, Buttons.Start });
                    gamePadMapping.Add("Pause", new Buttons[1] { Buttons.Start });
                    gamePadMapping.Add("MenuBack", new Buttons[1] { Buttons.B });
                    gamePadMapping.Add("Down", new Buttons[2] { Buttons.DPadDown, Buttons.LeftThumbstickDown });
                    gamePadMapping.Add("Up", new Buttons[2] { Buttons.DPadUp, Buttons.LeftThumbstickUp });
                    gamePadMapping.Add("Right", new Buttons[2] { Buttons.DPadRight, Buttons.LeftThumbstickRight });
                    gamePadMapping.Add("Left", new Buttons[2] { Buttons.DPadLeft, Buttons.LeftThumbstickLeft });
                    gamePadMapping.Add("Dance", new Buttons[1] { Buttons.A });
                    gamePadMapping.Add("Superflash", new Buttons[1] { Buttons.X });

                    break;

                case ControllerType.Keyboard:

                    keyboardMapping.Add("MenuSelection", new Keys[2] { Keys.Enter, Keys.Space });
                    keyboardMapping.Add("Pause", new Keys[2] { Keys.Pause, Keys.P });
                    keyboardMapping.Add("MenuBack", new Keys[1] { Keys.Escape });
                    keyboardMapping.Add("Down", new Keys[1] { Keys.Down });
                    keyboardMapping.Add("Up", new Keys[1] { Keys.Up });
                    keyboardMapping.Add("Right", new Keys[1] { Keys.Right });
                    keyboardMapping.Add("Left", new Keys[1] { Keys.Left });
                    keyboardMapping.Add("Dance", new Keys[1] { Keys.D });
                    keyboardMapping.Add("Superflash", new Keys[1] { Keys.S });

                    break;
            }

            #endregion
        }
开发者ID:iknowDavenMC,项目名称:SuperFlash,代码行数:53,代码来源:InputManager.cs


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