Esempio n. 1
0
    void Start()
    {
        cars = new List <CarRaceController>(GameObject.Find("Cars").GetComponentsInChildren <CarRaceController>());

        deathWallFollower = GameObject.Find("DeathWall").GetComponent <FollowPathV2>();
        deathWallFollower.followFromBehind      = true;
        deathWallFollower.desiredDistToFollower = deathWallDistance;

        finishLine = GameObject.Find("FinishLine");
        triggers   = GameObject.Find("LapTriggers").GetComponentsInChildren <LapTrigger>();

        pathDecisor = gameObject.GetComponent <PathDecisor>();

        carRespawner = GameObject.Find("CarRespawner").GetComponent <FollowPathV2>();
        carRespawner.followFromBehind      = true;
        carRespawner.desiredDistToFollower = carRespawnerDistance;

        bool lapCalculated = false;

        while (!lapCalculated)
        {
            lapCalculated = pathDecisor.CalculateLapPath();
        }
    }
 // Use this for initialization
 void Start()
 {
     body = transform.GetComponentInChildren<CarPhysicsController>();
     nodeToFollow = transform.GetComponentInChildren<FollowPathV2>();
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     body         = transform.GetComponentInChildren <CarPhysicsController>();
     nodeToFollow = transform.GetComponentInChildren <FollowPathV2>();
 }