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


C# Input.ButtonJustPressed方法代码示例

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


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

示例1: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput(Input input)
        {
            if (input.ButtonJustPressed((int)E_UiButton.Start) || input.ButtonJustPressed((int)E_UiButton.A))
            {
                _G.UI.MM_FromStartScreen = true;

                _UI.PrimaryPad = input.Controller.PadIndex;
                _UI.Screen.SetNextScreen(new Screen_MainMenu());
            }
        }
开发者ID:tuannsofta,项目名称:kinect4bag,代码行数:11,代码来源:Start.cs

示例2: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput(Input input)
        {
            if (input.ButtonJustPressed((int)E_UiButton.A)) {
                if (Menu.GetByValue() == 0) {
                    NugettaHandler connection = MyNugettaHandler.getInstance();
                    connection.FindGames((GetGamesResponse response) => {
                        List<NGame> list = response.getGames();
                        _UI.Screen.AddScreen(new JoinGame(list));
                    });
                    //_UI.Screen.AddScreen(new Screen_Popup(E_PopupType.NewGame));
                }
                else
                    if (Menu.GetByValue() == 1) {
                        _UI.Screen.SetNextScreen(null);
                    }
                    else
                        if (Menu.GetByValue() == 2) {
                            _UI.Screen.SetNextScreen(new Screen_Options());
                        }
                        else
                            if (Menu.GetByValue() == 3) {
                                _UI.Screen.AddScreen(new Screen_Popup(E_PopupType.Quit));
                            }
            }
            else
                if (input.ButtonJustPressed((int)E_UiButton.B)) {
                    SetScreenTimers(0.0f, 0.5f);

                    _G.UI.SS_FromMainMenu = true;

                    _UI.Screen.SetNextScreen(new Screen_Start());
                }
        }
开发者ID:ollesate,项目名称:TankGame,代码行数:34,代码来源:StartMenu.cs

示例3: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput(Input input)
        {
            if (LeftBar.ChildrenWidget.Count > 0)
            {
                if (input.ButtonJustPressed((int)E_UiButton.Down))
                {
                    LeftBar.IncreaseCurrent();
                }
                else if (input.ButtonJustPressed((int)E_UiButton.Up))
                {
                    LeftBar.DecreaseCurrent();
                }

            }
            if (RightBar.ChildrenWidget.Count > 0)
            {
                if (input.ButtonJustPressed((int)E_UiButton.Back))
                {
                    RightBar.DecreaseCurrent();
                }
                else if (input.ButtonJustPressed((int)E_UiButton.Enter))
                {
                    RightBar.IncreaseCurrent();
                }
            }
        }
开发者ID:tuannsofta,项目名称:kinect4bag,代码行数:27,代码来源:SideBar.cs

示例4: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput(Input input)
        {
            if (input.ButtonJustPressed((int)E_UiButton.A)) {
                int index = Menu.GetByValue();

                Controller c = MyController.getInstance();
                c.JoinGame(games[index].getId());
                _UI.Screen.SetNextScreen(null);

            }
            else
                if (input.ButtonJustPressed((int)E_UiButton.B)) {
                    SetScreenTimers(0.0f, 0.5f);

                    _G.UI.SS_FromMainMenu = true;

                    _UI.Screen.SetNextScreen(new Screen_Start());
                }
        }
开发者ID:ollesate,项目名称:TankGame,代码行数:20,代码来源:JoinGame.cs

示例5: OnProcessInput

 // OnProcessInput
 protected override void OnProcessInput( Input input )
 {
     if ( input.ButtonJustPressed( (int)E_UiButton.A ) )
     {
     _UI.Screen.AddMessage( (int)E_UiMessageType.PopupConfirm, (int)Type );
     _UI.Screen.SetNextScreen( null );
     }
     else
     if ( input.ButtonJustPressed( (int)E_UiButton.B ) )
     {
     _UI.Screen.AddMessage( (int)E_UiMessageType.PopupCancel, (int)Type );
     _UI.Screen.SetNextScreen( null );
     }
 }
开发者ID:ollesate,项目名称:TankGame,代码行数:15,代码来源:Popup.cs

示例6: DebugUpdate

        // DebugUpdate
        public void DebugUpdate( float frameTime, Input input )
        {
            if ( !d_Camera2dDebug )
            return;

            if ( input.ButtonJustPressed( (int)E_UiButton.LeftStick ) )
            Reset();
            else
            {
            float amount = d_Camera2dOffsetSpeed * frameTime;

            Offset.X -= amount * input.AxisValue( (int)E_UiAxis.LeftStickX );
            Offset.Y += amount * input.AxisValue( (int)E_UiAxis.LeftStickY );

            amount = d_Camera2dScaleSpeed * frameTime;

            Scale.X -= amount * input.ButtonValue( (int)E_UiButton.LeftTrigger );
            Scale.X += amount * input.ButtonValue( (int)E_UiButton.RightTrigger );

            if ( Scale.X < 0.0f )
                Scale.X = 0.0f;

            Scale.Y = Scale.X;
            }

            UpdateTransformMatrix();
        }
开发者ID:JacobNorlin,项目名称:project-duck,代码行数:28,代码来源:CameraSettings.cs

示例7: OnProcessInput

 // OnProcessInput
 protected override void OnProcessInput( Input input )
 {
     if ( input.ButtonJustPressed( (int)E_UiButton.B ) )
     _UI.Screen.SetNextScreen( new Screen_MainMenu() );
 }
开发者ID:tuannsofta,项目名称:kinect4bag,代码行数:6,代码来源:Options.cs

示例8: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput( Input input )
        {
            if ( Mode == 1 )
            {
            float delay = _UI.AutoRepeatDelay;
            float repeat = _UI.AutoRepeatRepeat;

            int oldSelection = CurrentSelectionLevel;

            if ( input.ButtonJustPressed( (int)E_UiButton.A ) )
            {
                _UI.Screen.SetNextScreen( new Screen_Loading() );
            }
            else
            if ( input.ButtonAutoRepeat( (int)E_UiButton.Up, delay, repeat ) )
            {
                if ( CurrentSelectionLevel > 3 )
                    CurrentSelectionLevel -= 4;
            }
            else
            if ( input.ButtonAutoRepeat( (int)E_UiButton.Down, delay, repeat ) )
            {
                if ( CurrentSelectionLevel < 12 )
                    CurrentSelectionLevel += 4;
            }
            else
            if ( input.ButtonAutoRepeat( (int)E_UiButton.Left, delay, repeat ) )
            {
                if ( ( CurrentSelectionLevel % 4 ) != 0 )
                    --CurrentSelectionLevel;
            }
            else
            if ( input.ButtonAutoRepeat( (int)E_UiButton.Right, delay, repeat ) )
            {
                if ( ( CurrentSelectionLevel % 4 ) != 3 )
                    ++CurrentSelectionLevel;
            }

            if ( oldSelection != CurrentSelectionLevel )
            {
                LevelNodes[ CurrentSelectionWorld ][ oldSelection ].TimelineActive( "select_level", false, true );
                LevelNodes[ CurrentSelectionWorld ][ CurrentSelectionLevel ].TimelineActive( "select_level", true, true );
            }
            }

            if ( input.ButtonJustPressed( (int)E_UiButton.A ) )
            {
            if ( Mode == 0 )
            {
                Mode = 1;
                Menu.Selected( false );
                MenuNodes[ CurrentSelectionWorld ].TimelineActive( "select_world", true, true );
                LevelNodes[ CurrentSelectionWorld ][ CurrentSelectionLevel ].TimelineActive( "select_level", true, true );
            }
            }
            else
            if ( input.ButtonJustPressed( (int)E_UiButton.B ) )
            {
            if ( Mode == 1 )
            {
                Mode = 0;
                Menu.Selected( true );
                MenuNodes[ CurrentSelectionWorld ].TimelineActive( "select_world", false, true );
                LevelNodes[ CurrentSelectionWorld ][ CurrentSelectionLevel ].TimelineActive( "select_level", false, true );
            }
            else
            {
                Backgrounds[ CurrentBackground ].Selected( false, false, true );
                _G.UI.MM_FromLevelSelect = true;
                _UI.Screen.SetNextScreen( new Screen_MainMenu() );
            }
            }
        }
开发者ID:ollesate,项目名称:TankGame,代码行数:74,代码来源:LevelSelect.cs

示例9: OnProcessInput

        // OnProcessInput
        protected override void OnProcessInput( Input input )
        {
            if ( input.ButtonJustPressed( (int)E_UiButton.A ) )
            {
            if ( Menu.GetByValue() == 0 )
            {
                _UI.Screen.AddScreen( new Screen_Popup( E_PopupType.NewGame ) );
            }
            else
            if ( Menu.GetByValue() == 1 )
            {
                Logo.TimelineActive( "end_fade", true, false );
                _UI.Screen.SetNextScreen( new Screen_LevelSelect() );
            }
            else
            if ( Menu.GetByValue() == 2 )
            {
                _UI.Screen.SetNextScreen( new Screen_Options() );
            }
            else
            if ( Menu.GetByValue() == 3 )
            {
                _UI.Screen.AddScreen( new Screen_Popup( E_PopupType.Quit ) );
            }
            }
            else
            if ( input.ButtonJustPressed( (int)E_UiButton.B ) )
            {
            SetScreenTimers( 0.0f, 0.5f );

            Logo.TimelineActive( "end_move", true, false );
            _G.UI.SS_FromMainMenu = true;

            _UI.Screen.SetNextScreen( new Screen_Start() );
            }
        }
开发者ID:jtavandenheuvel,项目名称:pcg-decoration-new,代码行数:37,代码来源:MainMenu.cs


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