Exemple #1
0
 private void BackButton()
 {
     if (controller.OperateTheMirror() || controller.Jump())
     {
         GameManager.Instance.ChangeScene(EScene.StageSelect);
     }
 }
    //ステージ決定
    void StageSelectEnter()
    {
        if (controller.Jump())
        {
            if (creditFlag)
            {
                creditButton.GetComponent <StageSelectScript>().ReturnStage();
                return;
            }
            //ステージがpanelButtonと同じ時用
            int index = page * transform.GetComponent <StagePanelCreate>().ReturnPanelPerButton() - 1;

            //stage % panelButton が0じゃないとき
            if (stage % panelButton != 0)
            {
                s = transform.GetChild(page - 1).GetChild(0).GetChild(stage % panelButton - 1).GetComponent <StageSelectScript>();
            }

            //0の時
            else
            {
                s = transform.GetChild(page - 1).GetChild(0).GetChild(index).GetComponent <StageSelectScript>();
            }

            s.ReturnStage();
        }
    }
Exemple #3
0
        public CommandResult Execute()
        {
            var res = controller.Jump();

            return(new CommandResult()
            {
                Response = res
            });
        }
Exemple #4
0
    // Update is called once per frame
    void Update()
    {
        if (controller.Jump())
        {
            SystemSE systemSE = GameManager.Instance.GetSystemSE();
            systemSE.PlaySystemSE(SystemSoundEnum.se_enter);

            GameManager.Instance.ChangeScene(EScene.StageSelect);
        }
    }
    //ジャンプ
    void Jump()
    {
        if (controller.IsFade())
        {
            return;
        }
        if (controller.Jump() && !isJump)
        {
            audio.clip = GetComponent <SEManager>().GetSE(0);
            audio.Play();

            GetComponent <Rigidbody>().AddForce(Vector3.up * jumpPower, ForceMode.Impulse);
            isJump = true;
            state  = EPlayerState.Jump;
        }
    }
    /// <summary>
    /// セレクトボタンが押された処理
    /// </summary>
    private void Select()
    {
        if (!controller.Jump())
        {
            return;
        }

        if (currentSelect == ESelection.TryAgain)
        {
            GameManager.Instance.TrySameStage(true);
            currentSelect = ESelection.Lock;                    //ロックする
            return;
        }
        GameManager.Instance.ChangeScene(EScene.StageSelect);
        currentSelect = ESelection.Lock;                        //ロックする
    }
Exemple #7
0
    /// <summary>
    /// トリガーボタン
    /// </summary>
    private void Trigger()
    {
        if (!controller.Jump())
        {
            return;
        }

        if (select == PauseSelectEnum.Retry)
        {
            Retry();
        }

        if (select == PauseSelectEnum.StageSelect)
        {
            StageSelect();
        }
    }
Exemple #8
0
    void FixedUpdate()
    {
        // Do nothing if character has not been instantiate
        if (character == null)
        {
            return;
        }

        // If character has been instantiate ...
        grounded = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, groundLayer);
        canJump  = grounded;
        anim.SetBool("grounded", grounded);
        anim.SetFloat("vSpeed", rigidbody2D.velocity.y);

        if (canJump)
        {
            if (player.GetButtonDown("X") || player.GetButtonDown("Y"))
            {
                characterController.Jump();
            }
//			var verticalAxis = player.GetAxis ("Control Stick Vertical");
//			if (verticalAxis == 1) {
//				playerController.grounded = false;
//				playerController.canJump = false;
//				newVelocity.y = playerController.jumpVelocity;
//				rigidbody2D.velocity = newVelocity;
//			}
        }

        if (canMove)
        {
            var move          = player.GetAxis("Control Stick Horizontal");
            var moveDirection = move > 0 ? 1 : -1;

            if (Mathf.Abs(move) > runThreshold)
            {
                rigidbody2D.velocity = new Vector2(moveDirection * runSpeed, rigidbody2D.velocity.y);
            }
            else if (Mathf.Abs(move) > 0)
            {
                rigidbody2D.velocity = new Vector2(moveDirection * walkSpeed, rigidbody2D.velocity.y);
            }

            anim.SetFloat("hSpeed", Mathf.Abs(move));

            if ((move < 0 && facingDirection == Direction.Right) ||
                (move > 0 && facingDirection == Direction.Left))
            {
                Flip();
            }
        }

        if (canAttack)
        {
            var horizontal  = player.GetAxis("Control Stick Horizontal");
            var vertical    = player.GetAxis("Control Stick Vertical");
            var cHorizontal = player.GetAxis("C Stick Horizontal");
            var cVertical   = player.GetAxis("C Stick Vertical");

            // A Button
            if (player.GetButtonDown("A"))
            {
                if (horizontal == -1)
                {
                    characterController.SmashLeft();
                }
                else if (horizontal == 1)
                {
                    characterController.SmashRight();
                }
                else if (vertical == -1)
                {
                    characterController.SmashDown();
                }
                else if (vertical == 1)
                {
                    characterController.SmashUp();
                }
                else
                {
                    characterController.Normal();
                }
            }
            // C Stick
            else if (cHorizontal != 0 || cVertical != 0)
            {
                if (cHorizontal == -1)
                {
                    characterController.SmashLeft();
                }
                else if (cHorizontal == 1)
                {
                    characterController.SmashRight();
                }
                else if (cVertical == -1)
                {
                    characterController.SmashDown();
                }
                else if (cVertical == 1)
                {
                    characterController.SmashUp();
                }
            }
            // B Button
            else if (player.GetButtonDown("B"))
            {
                if (horizontal == -1)
                {
                    characterController.SpecialLeft();
                }
                else if (horizontal == 1)
                {
                    characterController.SpecialRight();
                }
                else if (vertical == -1)
                {
                    characterController.SpecialDown();
                }
                else if (vertical == 1)
                {
                    characterController.SpecialUp();
                }
                else
                {
                    characterController.Special();
                }
            }
        }
    }
Exemple #9
0
        public void HandleCharacterControllerInput(GameTime gametime, ICharacterController controller)
        {
            float timescale = (float)gametime.ElapsedGameTime.TotalSeconds;
            float rotatescale = 1.5f;

            // Avoid moving with keyboard and mouse when the editor is open.
            if (controller.PlayerNumber == 0 && SunBurnEditorClient.Instance.EditorOpen)
                return;

            // Apply player input.
            controller.Move(new Vector2(_InputSources.MoveAmount.X, 0.0f));
            controller.Move(new Vector2(0.0f, _InputSources.MoveAmount.Y));
            controller.Turn(-_InputSources.TurnAmount * rotatescale);

            if (_InputSources.Jump)
                controller.Jump();

            controller.Crouch = _InputSources.Crouch;

            // Apply up / down view.
            _CharacterLookUpDownAngle += _InputSources.LookUpDownAmount * rotatescale * timescale;

            // Clamp the look up / down range.
            _CharacterLookUpDownAngle = MathHelper.Clamp(_CharacterLookUpDownAngle, -1.0f, 1.0f);
        }