• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ControllerType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: CheckForAuthorise

        public static bool CheckForAuthorise(this TypeViewer typeViewer, ControllerType controllerType)
        {
            var webApiAuthorizeAttributeName = typeof(System.Web.Http.AuthorizeAttribute).Name;

            var mvcAuthorizeAttributeName = typeof(System.Web.Mvc.AuthorizeAttribute).Name;

            var attributeToDetect = (controllerType == ControllerType.MVC)
                                    ? mvcAuthorizeAttributeName
                                    : webApiAuthorizeAttributeName;

            var classValidation = typeViewer.HasClassAttribute(attributeToDetect);
            var methodValidation = typeViewer.HasMethodAttribute(attributeToDetect);

            return classValidation || methodValidation;
        }
开发者ID:gitter-badger,项目名称:Sitecore.Glimpse,代码行数:15,代码来源:TypeViewerExtensions.cs


示例17: Awake

 //    private CameraController camCont;
 void Awake()
 {
     anim=gameObject.GetComponentInChildren<Animator>();
     attacking=false;
     attacked=false;
     jmp=false;
     jumpButton=false;
     attackButton=false;
     jumpForce=Mathf.Abs (jumpForce);
     buttonOffset=Mathf.Abs (buttonOffset);
     attackWaitTime=Mathf.Abs (attackWaitTime);
     controllerSelection=ControllerType.Computer;
     attackTimer=0;
     b1=0;
     b2=0;
 }
开发者ID:angrykoala,项目名称:time-reaver,代码行数:17,代码来源:PlayerController.cs


示例18: VSPController

        public VSPController(ControllerMode controller_mode, ControllerType controller_type)
            : base()
        {
            BorderStyle = BorderStyle.Fixed3D;
            //Size = new System.Drawing.Size(340,164);

            c_VspView = new vspView(c_ScrollBar,controller_mode,controller_type);
            c_VspView.Size = new System.Drawing.Size(Global.VSP_SIZE_PIXELS,Height-4);
            c_VspView.Location = new System.Drawing.Point(0,0);

            c_ScrollBar.Size = new System.Drawing.Size(16,Height-4);
            c_ScrollBar.Location = new System.Drawing.Point(Global.VSP_SIZE_PIXELS,0);
            c_ScrollBar.ValueChanged += new EventHandler(c_VspView.OnScroll);

            Controls.Add(c_VspView);
            Controls.Add(c_ScrollBar);
        }
开发者ID:zeromus,项目名称:maped3,代码行数:17,代码来源:VSPController.cs


示例19: CheckForMitigations

        public static Csrf CheckForMitigations(this TypeViewer typeViewer, ControllerType controllerType)
        {
            const string webApiAntiForgeryAttributeName = "ValidateHttpAntiForgeryTokenAttribute";

            var mvcAntiForgeryAttributeName = typeof(System.Web.Mvc.ValidateAntiForgeryTokenAttribute).Name;

            var attributeToDetect = (controllerType == ControllerType.MVC)
                        ? mvcAntiForgeryAttributeName
                        : webApiAntiForgeryAttributeName;

            var classValidation = typeViewer.HasClassAttribute(attributeToDetect);
            var methodValidation = typeViewer.HasMethodAttribute(attributeToDetect);

            return classValidation ? Csrf.Class 
                : methodValidation ? Csrf.Method 
                    : Csrf.None;
        }
开发者ID:gitter-badger,项目名称:Sitecore.Glimpse,代码行数:17,代码来源:TypeViewerExtensions.cs


示例20: getNewIInputManager

        public IInputManager getNewIInputManager(ControllerType type)
        {
            switch (type)
            {
                case ControllerType.PadOne:
                    return new PadInputManager(PlayerIndex.One);
                case ControllerType.PadTwo:
                    return new PadInputManager(PlayerIndex.Two);
                case ControllerType.PadThree:
                    return new PadInputManager(PlayerIndex.Three);
                case ControllerType.PadFour:
                    return new PadInputManager(PlayerIndex.Four);

                case ControllerType.Keyboard:
                default:
                    return new KeyInputManager();
            }
        }
开发者ID:Jamedjo,项目名称:BeatShift,代码行数:18,代码来源:AnyInputManager.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls类代码示例发布时间:2022-05-24
下一篇:
C# ControllerContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap