コード例 #1
0
    /// <summary>
    /// バク転
    /// </summary>
    private void BackFlip()
    {
        //this._velocity.y = this.backFlipVerticalSpeed;
        this._isGrounded = false;

        //進行方向を向く
        if (!(this._velocity.x == 0f && this._velocity.z == 0f))
        {
            this.transform.forward = new Vector3(this._velocity.x, 0f, this._velocity.z);
        }
        this._velocity = this.transform.forward * -1 * this.backFlipHorizontalSpeed + this.transform.up * this.backFlipVerticalSpeed;
        this._hitHeadCheck.localPosition = Vector3.zero;
        this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero);
        this._groundCheck.localPosition  = Vector3.zero;
        this._groundCheck.localRotation  = Quaternion.Euler(Vector3.zero);
        StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this.transform, this.CenterPosition, E_TransformAxis.Right, -1080f, 1f));
        StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this._hitHeadCheck, this.CenterPosition, E_TransformAxis.Right, 1080f, 1f));
        StartCoroutine(TransformManager.RotateInCertainTimeByFixedAxisFromAway(this._groundCheck, this.CenterPosition, E_TransformAxis.Right, 1080f, 1f));
        StartCoroutine(CoroutineManager.DelayMethod(1.1f, () =>
        {
            this._hitHeadCheck.localPosition = Vector3.zero;
            this._hitHeadCheck.localRotation = Quaternion.Euler(Vector3.zero);
            this._groundCheck.localPosition  = Vector3.zero;
            this._groundCheck.localRotation  = Quaternion.Euler(Vector3.zero);
        }));

        //this.canStickWall = false;
        //StartCoroutine(CoroutineManager.DelayMethod(0.3f, () => this.canStickWall = true));

        this.currentState = E_State.BackFliping;
        this._playerAnimation.Play(PlayerAnimation.E_PlayerAnimationType.BackFlip);
        SEManager.Instance.Play(SEPath.JUMP_VOICE1);
        SEManager.Instance.Play(SEPath.JUMP_WIND0);
        StartCoroutine(CoroutineManager.DelayMethod(0.4f, () => SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.8f)));
        StartCoroutine(CoroutineManager.DelayMethod(0.8f, () => SEManager.Instance.Play(SEPath.JUMP_WIND0, volumeRate: 0.8f)));
    }