Ejemplo n.º 1
0
    public void CheckpointTrigger(GameObject cp, MyRaceAgent agent)
    {
        int     index            = checkpoints.IndexOf(cp);
        Vector3 nxtCheckpointPos = checkpoints[(index + 1) % NCheckpoints].transform.position;

        agent.CheckpointTrigger(nxtCheckpointPos, index);
    }
Ejemplo n.º 2
0
    void OnTriggerEnter(Collider other)
    {
        // MyRaceAgent agent = other.gameObject.GetComponent<MyRaceAgent>();
        MyRaceAgent       agent   = other.GetComponentInParent <MyRaceAgent>();
        CheckpointManager manager = GetComponentInParent <CheckpointManager>();

        manager.CheckpointTrigger(gameObject, agent);
    }