示例#1
0
 public void RemoveWaypoint(WaypointClass waypoint)
 {
     for (int i = 0; i < waypointList.Count; ++i)
     {
         if (waypointList[i] == waypoint)
         {
             waypointList.Remove(waypointList[i]);
         }
     }
 }
示例#2
0
    // Use this for initialization
    void Start()
    {
        WaypointScript = GameObject.Find("MainGame").GetComponent <WaypointClass>();

        //Initialise FearMachine Variables
        TheFearMachine.EnemyGO          = "Fear Machine";
        TheFearMachine.CurrentPosition  = GameObject.Find(TheFearMachine.EnemyGO).transform.position;
        TheFearMachine.CurrentWaypoint  = 10;
        TheFearMachine.CurrentDirection = new Vector2(0, -1);
        TheFearMachine.CurrentMaxSpeed  = TheFearMachine.OriginalMaxSpeed;
        TheFearMachine.BoundingBoxSize  = BoundingSquareRadius;
    }
示例#3
0
    // Use this for initialization
    void Start()
    {
        BehaviourTreeScript = GameObject.Find("MainGame").GetComponent <AIRacerBehaviourTree>();
        WaypointScript      = GameObject.Find("MainGame").GetComponent <WaypointClass>();

        for (int i = 0; i < AIRacerList.Length; i++)
        {
            AIRacerList[i].StatusAilment      = "Normal";
            AIRacerList[i].Lap                = 1;
            AIRacerList[i].CalculatedRank     = 0;
            AIRacerList[i].CurrentPosition    = GameObject.Find(DriverGOList[i]).transform.position;
            AIRacerList[i].CurrentWaypoint    = 0;
            AIRacerList[i].CurrentDirection   = new Vector2(0, 1);
            AIRacerList[i].DriverGO           = DriverGOList[i];
            AIRacerList[i].CurrentMaxSpeed    = AIRacerList[i].OriginalMaxSpeed;
            AIRacerList[i].RubberbandingSpeed = AIRacerList[i].OriginalMaxSpeed * 2f;
            CalculatedRanksList[i]            = AIRacerList[i].CalculatedRank;
        }
    }
示例#4
0
    // Start is called before the first frame update
    void Start()
    {
        Ray        CastToGround = new Ray(transform.position, Vector3.down);
        RaycastHit hit;

        if (Physics.Raycast(CastToGround, out hit))
        {
            //Getting the variables
            var tempWaypointmanager = GameObject.FindGameObjectWithTag("WaypointManager");
            var accessingVar        = tempWaypointmanager.GetComponent <WaypointManager>();

            //Creating a new waypoint
            WaypointClass newWaypoint = new WaypointClass();

            //Setting the position
            newWaypoint.SetRayCast(hit.point);
            newWaypoint.SetPos(transform.position);

            //Adding into the list
            accessingVar.AddWaypoint(newWaypoint);
        }
    }
示例#5
0
 public void AddWaypoint(WaypointClass waypoint)
 {
     waypointList.Add(waypoint);
 }