示例#1
0
    void Jump()
    {
        isJump = true;
        anim.SetTrigger("JumpWall");
        Flip.FlipIfCanFlip(inputDirection * -1);
        //   Flip.transform.localPosition = new Vector3(OffSetSpriteX * inputDirection.x * -1, Flip.transform.localPosition.y, Flip.transform.localPosition.z);
        Flip.transform.localPosition = new Vector3(OffSetSpriteX * 1 * -1, Flip.transform.localPosition.y, Flip.transform.localPosition.z);

        if (isChange)
        {
            StopCoroutine("ChangeStateMove");
            isChange = false;
        }
        canInputCheckWallJump = false;
        StartCoroutine(timerVar.StartTime(SetInputAgainTrue, InputForWallAgain));

        int dir = 0;

        if (isLeftSide)
        {
            dir = 1;
        }
        else
        {
            dir = -1;
        }
        if (useJump)
        {
            move.FirstJump(TimeNoInput, dir);
        }
        else
        {
            float multiplyX = 1.0f;
            if ((isLeftSide && inputDirection.x > 0) ||
                (isRigthSide && inputDirection.x < 0))
            {
                //  multiplyX = MultyplyForceOtherDireccion;
            }
            Vector2 normalFactorSpeed = FactorForNormalSpeed;
            if (move.canRun)
            {
                normalFactorSpeed = FactorForRunSpeed;
            }

            move.ApplyForce(new Vector2(dir, 1).normalized, force.x * multiplyX * normalFactorSpeed.x, force.y * normalFactorSpeed.y, true, TimeNoInput);

            move.SetIsNONWhenJump();
        }

        FX.Spawn(move.groundCheck.position);
        //Klvo
        jumpSFX.Play();
        fsm.PerformTransition(Transition.Move_WallJump);
    }