Exemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        CarInfo info = other.transform.parent.parent.GetComponent <CarInfo>();

        if (info != null)
        {
            if (info.Next == this.gameObject)
            {
                info.Next = m_nextCheckpoint;
                if (m_endLapCheckpoint)
                {
                    if (other.gameObject.tag == "Player")
                    {
                        m_currentCheckpoint = this.gameObject;
                        m_hud.UpdateLaps(info, true);
                    }
                    else
                    {
                        m_hud.UpdateLaps(info, false);
                    }
                }
                else
                {
                    if (other.gameObject.tag == "Player")
                    {
                        m_currentCheckpoint = this.gameObject;
                    }
                    info.IncreaseCheckpoints();
                }
            }
        }
    }