Пример #1
0
    public override TaskStatus OnUpdate()
    {
        float myLoc       = WAX_Utilities.targetCheck(thisPlayer.transform.position, thisPlayer.myGoal.transform.position);
        float ballLoc     = WAX_Utilities.targetCheck(thisPlayer.ball.transform.position, thisPlayer.myGoal.transform.position);
        float opponentLoc = WAX_Utilities.targetCheck(thisPlayer.opponent.transform.position, thisPlayer.myGoal.transform.position);

        return(myLoc - opponentLoc > myLoc - ballLoc  ? TaskStatus.Success : TaskStatus.Failure);
    }
Пример #2
0
    public override TaskStatus OnUpdate()
    {
        float ballSize = 4.8f / 50f;
        float myLoc    = WAX_Utilities.targetCheck(thisPlayer.transform.position, thisPlayer.myGoal.transform.position);
        float ballLoc  = WAX_Utilities.targetCheck(thisPlayer.ball.transform.position, thisPlayer.myGoal.transform.position);

        return(myLoc < ballLoc + ballSize ? TaskStatus.Success : TaskStatus.Failure);
    }
Пример #3
0
    public override TaskStatus OnUpdate()
    {
        WAX_Utilities.moveToTarget(thisPlayer.myGoal.transform.position, rb, thisPlayer.transform, thisPlayer.targetSphere, thisPlayer.physicsForce);
        {
            float myLoc   = WAX_Utilities.targetCheck(thisPlayer.transform.position, thisPlayer.myGoal.transform.position);
            float ballLoc = WAX_Utilities.targetCheck(thisPlayer.ball.transform.position, thisPlayer.myGoal.transform.position);

            return(myLoc < ballLoc ? TaskStatus.Success : TaskStatus.Failure);
        }
    }
Пример #4
0
    public override TaskStatus OnUpdate()
    {
        WAX_Utilities.moveToTarget(thisPlayer.opponentGoal.transform.position, rb, thisPlayer.transform, thisPlayer.targetSphere, thisPlayer.physicsForce);

        //this is going to be to keep the player from running across goal line
        float myLoc   = WAX_Utilities.targetCheck(thisPlayer.transform.position, thisPlayer.myGoal.transform.position);
        float ballLoc = WAX_Utilities.targetCheck(thisPlayer.ball.transform.position, thisPlayer.myGoal.transform.position);

        //float scoreLoc = WAX_Utilities.targetCheck(thisPlayer.opponentGoal.transform.position, thisPlayer.myGoal.transform.position);

        return(myLoc < ballLoc && ballLoc > +3 ? TaskStatus.Success : TaskStatus.Failure);
    }
Пример #5
0
    public override TaskStatus OnUpdate()
    {
        Vector3 playerPos   = thisPlayer.transform.position;
        Vector3 defenseGoal = thisPlayer.myGoal.transform.position;
        Vector3 ballPos     = thisPlayer.ball.transform.position;


        Vector3 ballToGoal = ballPos - thisPlayer.opponentGoal.transform.position;

        ballToGoal.Normalize();

        Vector3 goalTarget = ballPos - ballToGoal * 3f;

        WAX_Utilities.moveToTarget(goalTarget, rb, thisPlayer.transform, thisPlayer.targetSphere, thisPlayer.physicsForce);

        if (WAX_Utilities.targetCheck(playerPos, defenseGoal) > .95 ||
            WAX_Utilities.targetCheck(playerPos, defenseGoal) > WAX_Utilities.targetCheck(ballPos, defenseGoal))
        {
            //Trying to get this to stop
            //thisPlayer.transform.rotation = Quaternion.Euler(0, thisPlayer.transform.eulerAngles.y, 0);
            return(TaskStatus.Success);
        }
        return(TaskStatus.Failure);
    }
Пример #6
0
 public override TaskStatus OnUpdate()
 {
     WAX_Utilities.moveToTarget(thisPlayer.ball.transform.position, rb, thisPlayer.transform, thisPlayer.targetSphere, thisPlayer.physicsForce);
     return(TaskStatus.Success);
 }
Пример #7
0
 public override TaskStatus OnUpdate()
 {
     return(WAX_Utilities.targetCheck(thisPlayer.ball.transform.position, thisPlayer.myGoal.transform.position) < 0.5f ? TaskStatus.Success : TaskStatus.Failure);
 }