Пример #1
0
    private bool CheckCollisionType(Vector3 velocityChange)
    {
        CollisionType collisionType = worldCollision.GetCollisionSafe();

        switch (collisionType)
        {
        case CollisionType.WallLeft:
            if (!WallCase(velocityChange, 1))
            {
                return(false);
            }
            break;

        case CollisionType.WallRight:
            if (!WallCase(velocityChange, -1))
            {
                return(false);
            }
            break;

        case CollisionType.CeilingLeft:
        case CollisionType.CeilingRight:
        case CollisionType.Ceilling:
            Debug.Log("ici ne pas slider...");
            return(false);

        default:
            //ici on est pas en wallJump, on peut bouger normalement !
            break;
        }
        return(true);
    }
Пример #2
0
    private void WallJumpSimple()
    {
        Debug.Log("ici jump wall selon wallLeft/right et Up");
        Vector3 horiz = new Vector3(((worldCollision.GetCollisionSafe() == CollisionType.WallLeft) ? 1 : -1), 0, 0);
        Vector3 dir   = QuaternionExt.GetMiddleOf2Vector(Vector3.up, horiz);
        float   boost = playerJump.JumpBoostFromWall;

        Jump(dir, false, 0, boost);
    }