public void createinfectDogObject(int groupsize) { //In Latitude, the map is drawn in vector of (+Lon, -Lat) direction int lastIndex = infectedlocations.Count - 1; float lat = (float)infectedlocations[lastIndex].x; float lon = (float)infectedlocations[lastIndex].y; int at_lat = getLatGridIndex(abs(s_lat - lat)); int at_lon = getLonGridIndex(abs(s_lon - lon)); //temporaly tempinfect = new LatLonSize(at_lat, at_lon, groupsize); Debug.Log("latx" + at_lat + "lony" + at_lon); // spawninfectedPrefab(lat, lon); }
//create the object to the map location (with default height) public void createDogObject(float groupsize) { //In Latitude, the map is drawn in vector of (+Lon, -Lat) direction int lastIndex = doglocations.Count - 1; float lat = (float)doglocations[lastIndex].x; float lon = (float)doglocations[lastIndex].y; int at_lat = getLatGridIndex(abs(s_lat - lat)); int at_lon = getLonGridIndex(abs(s_lon - lon)); //temporaly //for lat lon recheck if (at_lat >= 0 && at_lat < x_gsize && at_lon >= 0 && at_lon < y_gsize) { tempdoglocation = new LatLonSize(at_lat, at_lon, groupsize); } else { if (at_lat < 0) { at_lat = 0; } if (at_lat >= x_gsize) { at_lat = x_gsize - 1; } if (at_lon < 0) { at_lon = 0; } if (at_lon >= y_gsize) { at_lon = y_gsize - 1; } tempdoglocation = new LatLonSize(at_lat, at_lon, 0.0f); } // spawnDogPrefabWithHeight(lat, lon); }