Ejemplo n.º 1
0
    void OnCollisionEnter(Collision info)
    {
        MapPoint city = info.transform.GetComponent<MapPoint>();
        if (endPointA == null) {
            endPointA = city;
            endPointA.AddConnectedPath(this);
        }
        else {
            endPointB = city;
            endPointB.AddConnectedPath(this);

            endPointA.AddConnectedCity(endPointB);
            endPointB.AddConnectedCity(endPointA);

            transform.parent.GetComponent<MapPathManager>().CompletedPath();
        }
    }