Ejemplo n.º 1
0
    public void NextCheckpoint()
    {
        currentCheckpoint++;

        for (int a = 0; a < checkpoints.Length; a++)
        {
            checkpoints [a].SetActive(false);
        }

        if (checkpoints.Length > currentCheckpoint)
        {
            checkpoints [currentCheckpoint].SetActive(true);
        }

        fLight.SetTarget(checkpoints [currentCheckpoint].transform);
    }
Ejemplo n.º 2
0
    IEnumerator Start()
    {
        for (int a = 0; a < checkpoints.Length; a++)
        {
            checkpoints [a].SetActive(false);
        }

        checkpoints [0].SetActive(true);

        // Wait a frame to vehicle had spawned
        yield return(new WaitForEndOfFrame());



        fLight = GameObject.FindGameObjectWithTag("Player").GetComponent <FlashLight> ();

        fLight.SetTarget(checkpoints [currentCheckpoint].transform);

        fLight.isActive = true;
    }