示例#1
0
    protected override void FixedUpdateChild()
    {
        if (resume)
        {
            float speedPaltformX = 0;
            float speedPaltformY = rigidBody2D.velocity.y;

            if (moveState.getOnPlatform() != null && typeC == TypeCrush.Middle)
            {
                speedPaltformX = moveState.getOnPlatform().velocity.x;
                speedPaltformY = moveState.getOnPlatform().velocity.y;
            }
            rigidBody2D.velocity = new Vector2(Mathf.Clamp(speedPaltformX, -moveState.MaxSpeed.x, moveState.MaxSpeed.x), Mathf.Clamp(speedPaltformY, -moveState.MaxSpeed.y, moveState.MaxSpeed.y));

            moveState.checkGround();
            if (moveState.isGround)
            {
                moveState.CheckHeadKill();
            }
        }
    }