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


C# ControlScheme类代码示例

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


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

示例1: Action

    public List<ControlKey> Keys;// = new List<ControlKey>();

    public Action(ControlScheme scheme, string name = "defaultAction")//:base(scheme, name)
    {
        Keys = new List<ControlKey>();

        this.scheme = scheme;
        this.Name = name;
    }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:9,代码来源:Action.cs

示例2: Axis

    public Axis(ControlScheme scheme, string name = "defaultAxis")
        //: base(scheme, name)
    {
        AxisKeys = new List<AxisKey>();

        this.scheme = scheme;
        this.Name = name;
    }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:8,代码来源:Axis.cs

示例3: PlayerData

 public PlayerData(int id, int carType, ControlScheme ctrlScheme, PlayerType playerType)
 {
     _carType = carType;
     _ctrlScheme = ctrlScheme;
     _playerType = playerType;
     _lives = 10;
     ID = id;
 }
开发者ID:JeanPascalEvette,项目名称:DodgeThisRacing,代码行数:8,代码来源:PlayerData.cs

示例4: Start

 // Use this for initialization
 void Start()
 {
     controlScheme = ControlManager.Instance.ControlSchemes[0];
     InstrumentInHand = ((GameObject)GameObject.Instantiate(InstrumentsInCollection.First().gameObject)).GetComponent<Instrument>();
     InstrumentInHand.gameObject.SetActive(true);
     InstrumentInHand.transform.position = transform.position;
     InstrumentInHand.transform.parent = transform;
     player = transform.parent.Find("PlayerCharacter");
 }
开发者ID:Bahamutho,项目名称:GJ01-Jazz-Climbing,代码行数:10,代码来源:InstrumentManager.cs

示例5: Start

    // Use this for initialization
    void Start()
    {
        movPhysics = this.GetComponent<DirectMovementPhysics>();
        spellController = this.GetComponent<SpellController>();
        stats = this.GetComponent<Stats>();

        controlScheme = ControlManager.GetControlScheme(1);
        //Spells = new List<ISpellBase>();
        //Actions = new List<Action>();
    }
开发者ID:Bahamutho,项目名称:GJ03-ParagonShmup,代码行数:11,代码来源:PlayerController.cs

示例6: GetDirection

    public static Vector2 GetDirection(ControlScheme controlScheme)
    {
        if (!controlsEnabled)
            return Vector2.zero;

        Vector2 direction = Vector2.zero;

        switch (controlScheme)
        {
            case ControlScheme.KeyboardZQSD:
                if (Input.GetKey(KeyCode.Z))
                    direction.y = 1;
                else if (Input.GetKey(KeyCode.S))
                    direction.y = -1;
                if (Input.GetKey(KeyCode.Q))
                    direction.x = -1;
                else if (Input.GetKey(KeyCode.D))
                    direction.x = 1;
                break;
            case ControlScheme.KeyboardOKLM:
                if (Input.GetKey(KeyCode.O))
                    direction.y = 1;
                else if (Input.GetKey(KeyCode.L))
                    direction.y = -1;
                if (Input.GetKey(KeyCode.K))
                    direction.x = -1;
                else if (Input.GetKey(KeyCode.M))
                    direction.x = 1;
                break;
            case ControlScheme.Keyboard5123:
                if (Input.GetKey(KeyCode.Keypad5))
                    direction.y = 1;
                else if (Input.GetKey(KeyCode.Keypad2))
                    direction.y = -1;
                if (Input.GetKey(KeyCode.Keypad1))
                    direction.x = -1;
                else if (Input.GetKey(KeyCode.Keypad3))
                    direction.x = 1;
                break;
            case ControlScheme.Gamepad1:
                direction = GetJoystickAxis(1);
                break;
            case ControlScheme.Gamepad2:
                direction = GetJoystickAxis(2);
                break;
            case ControlScheme.Gamepad3:
                direction = GetJoystickAxis(3);
                break;
            default:
                break;
        }

        return direction;
    }
开发者ID:julesbriquet,项目名称:Almarach,代码行数:54,代码来源:Controls.cs

示例7: changeControlScheme

 //Cycle through control schemes.
 public void changeControlScheme()
 {
     if ((int)controlScheme == 5)
     {
         controlScheme = ControlScheme.Unspecified;
     }
     else
     {
         controlScheme = (ControlScheme)((int)controlScheme + 1);
     }
 }
开发者ID:EnigmaBADGER,项目名称:DropTheGoat,代码行数:12,代码来源:Player.cs

示例8: Update

    public void Update(ControlScheme inputScheme = null)
    {
        if (scheme == null && inputScheme != null)
            scheme = inputScheme;

        foreach (ControlKey key in Keys)
        {
            key.LastState   = key.CurState;
            key.CurState    = IsCKDown(key);
            
            if(key.LastState && scheme != null)
                scheme.InputType = key.Type;
        }
    }
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:14,代码来源:Action.cs

示例9: Start

	// Use this for initialization
	void Start ()
    {
        cc = gameObject.GetComponent<Iso2DCharacterController>();

        if (ControlScheme == null)
        {
            ControlScheme = ControlScheme.CreateScheme<PlayerActions>();
            ControlScheme.Actions[(int)PlayerActions.PickPocket].Keys.Add(ControlKey.PCKey(KeyCode.Space));
            ControlScheme.Actions[(int)PlayerActions.PickPocket].Keys.Add(ControlKey.XboxButton(XboxCtrlrInput.XboxButton.A));
            ControlScheme.Actions[(int)PlayerActions.Dance].Keys.Add(ControlKey.PCKey(KeyCode.Q));
            ControlScheme.Actions[(int)PlayerActions.Dance].Keys.Add(ControlKey.XboxButton(XboxCtrlrInput.XboxButton.B));
            ScriptableObjectHelper.SaveAssetAutoNaming(ControlScheme);
            //ControlScheme.hideFlags = HideFlags.DontSave;

        }
	}
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:17,代码来源:Iso2DPlayerController.cs

示例10: CheckInPlayer

    void CheckInPlayer(ControlScheme scheme)
    {
        var newPlayer = new Player() { id = players.Count + 1, controls = scheme };
        players.Add(newPlayer);

        bool isPad = scheme.ToString().StartsWith("Gamepad");

        // show his key mapping :
        schemeSelection[newPlayer.id - 1].GetComponent<Image>().overrideSprite =
            buttonConfigs[(newPlayer.id - 1) * 4 + GetMappingIndex(scheme)];
        //if (isPad)
        //    playerGamepadMappings[newPlayer.id - 1].gameObject.SetActive(true);
        //else
        //    playerKeyMappings[newPlayer.id - 1].gameObject.SetActive(true);

        playerOverlays[newPlayer.id - 1].gameObject.SetActive(true);
    }
开发者ID:julesbriquet,项目名称:Almarach,代码行数:17,代码来源:ControlsSelection.cs

示例11: Start

	// Use this for initialization
	void Start () 
    {
        cc = gameObject.GetComponent<SimpleIsoCharacterController>();
        pp = gameObject.GetComponent<PickPocket>();
        anim = new AnimationSwapAnimatorWrapper(gameObject);

        if(ControlScheme == null)
        {
            ControlScheme = ControlScheme.CreateScheme<PlayerActions>();
            ControlScheme.Actions[(int)PlayerActions.PickPocket].Keys.Add(ControlKey.PCKey(KeyCode.Space));
            ControlScheme.Actions[(int)PlayerActions.PickPocket].Keys.Add(ControlKey.XboxButton(XboxCtrlrInput.XboxButton.A));

            ScriptableObjectHelper.SaveAssetAutoNaming(ControlScheme);
            //ControlScheme.hideFlags = HideFlags.DontSave;

        }
        
	}
开发者ID:Bahamutho,项目名称:GJ04-ST.-STELF-EALTH,代码行数:19,代码来源:PlayerControl.cs

示例12: SelectControlsCoroutine

 private IEnumerator SelectControlsCoroutine()
 {
     while (true)
     {
         if (Input.GetKeyDown(KeyCode.Space))
         {
             _selectedControl = ControlScheme.Keyboard;
             StartCoroutine(FadeOutTitleCoroutine());
             yield break;
         }
         if (STMReceiver.Instance.Buttons.BreakButtonDown)
         {
             _selectedControl = ControlScheme.Stm;
             StartCoroutine(FadeOutTitleCoroutine());
             yield break;
         }
         yield return null;
     }
 }
开发者ID:ksanu,项目名称:SuperTrackMayhem,代码行数:19,代码来源:StartingSequence.cs

示例13: ChooseCharacter

    void ChooseCharacter(ControlScheme scheme, float leftRight)
    {
        var player = players.First(p => p.controls == scheme);
        var rect = playerOverlays[player.id - 1].gameObject.GetComponent<RectTransform>();

        var currentPos = rect.anchorMax;
        if (leftRight < 0)
        {
            //move left
            _audioSource.PlayOneShot(moveSound);
            currentPos.x = currentPos.x == 0f ? 1f : currentPos.x - 0.5f;
        }
        else
        {
            //move right
            _audioSource.PlayOneShot(moveSound);
            currentPos.x = currentPos.x == 1f ? 0f : currentPos.x + 0.5f;
        }
        rect.anchorMax = currentPos;
        rect.anchorMin = currentPos;
    }
开发者ID:julesbriquet,项目名称:Almarach,代码行数:21,代码来源:ControlsSelection.cs

示例14: UsePowerUp

    public static bool UsePowerUp(ControlScheme controlScheme)
    {
        if (!controlsEnabled)
            return false;

        switch (controlScheme)
        {
            case ControlScheme.KeyboardZQSD:
                return Input.GetKey(KeyCode.LeftShift);
            case ControlScheme.KeyboardOKLM:
                return Input.GetKey(KeyCode.Return);
            case ControlScheme.Keyboard5123:
                return Input.GetKey(KeyCode.KeypadEnter);
            case ControlScheme.Gamepad1:
                return GetJoystickButton(1);
            case ControlScheme.Gamepad2:
                return GetJoystickButton(2);
            case ControlScheme.Gamepad3:
                return GetJoystickButton(3);
        }
        return false;
    }
开发者ID:julesbriquet,项目名称:Almarach,代码行数:22,代码来源:Controls.cs

示例15: Tank

        public Tank(int playerIndex, Vector2 position, int team, ControlScheme controlScheme, Rectangle screenBounds)
            : base("Sprites", position, Map.TileSize, Map.TileSize, true, SpriteHelper.GetDefaultDepth(SpriteHelper.SpriteDepth.Middle))
        {
            _playerIndex = playerIndex;
            _team = team;
            _screenBounds = screenBounds;
            _usedControlScheme = controlScheme;
            if ((int)_usedControlScheme > 2)
            {
                _gamePadIndex = (PlayerIndex)_usedControlScheme - 3;
            }

            //Cannon
            SetOrigin(16, 16);
            cannon = new Sprite("Sprites", position, 26, 16, false, SpriteHelper.GetDefaultDepth(SpriteHelper.SpriteDepth.Middle) + 0.1f);
            cannon.SetTextureRectangle(new Rectangle(96 + (32 * _team), 64, 26, 16));
            cannon.SetOrigin(8f, 8f);
            cannon.position = position;
            _spriteOverlays.Add(cannon);

            //Animation
            AddAnimationState(new SpriteState("MovingHorizontal", SpriteHelper.GetSpriteRectangleStrip(32, 32, 0, 3 + _team, 3 + _team, 0, 2), _animationSpeed));
            _orientation = new Vector2(1, 0);
            _currentAnimationState = "MovingHorizontal";
            SetCurrentAnimationState(_currentAnimationState);
            InitiateAnimationStates();

            //Statbar
            statsBarPosition = new Vector2(20 + (playerIndex * 290), 24);
            if (playerIndex > 1)
            {
                statsBarPosition.X -= 90;
            }
            tankSprite = new Sprite("Sprites", (int)statsBarPosition.X, (int)statsBarPosition.Y, new Rectangle(96 + (32 * team), 112, 32, 32), 1);
            _healthBar = new HealthBar((int)statsBarPosition.X + 42, (int)statsBarPosition.Y, 116, 30, Color.Green, Color.Red, Color.Black);
            powerupRectangle = new Sprite("Sprites", _healthBar.x+100+32,21, 1);
            powerupRectangle.SetTextureRectangle(new Rectangle(0, 176, 36, 36));
        }
开发者ID:kralle333,项目名称:TankGame,代码行数:38,代码来源:Tank.cs


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