private void GeneratePlaces(Coordinates currentLocation) { for (int i = 0; i < places.placeList.Count; i++) { PlaceData currentPlace = places.placeList[i]; GameObject temp = Instantiate(objectDatabase[currentPlace.objectModelID].iconObject); temp.name = currentPlace.namaTempat + " _ARZoneIcon"; IconObjectController iconController = temp.GetComponent <IconObjectController>(); if (iconController != null) { iconController.PlaceData = currentPlace; // if (FO.visitedPlace.Contains(currentPlace.namaTempat)) // { // iconController.canBeClicked = false; // } // else // { // iconController.canBeClicked = true; // } } goMap.dropPin(currentPlace.lat, currentPlace.lon, temp); Debug.Log("Dropping pin " + currentPlace.namaTempat); } }
private void Start() { Instantiate(chest); for (int i = 0; i < coordinatesGPS.Length; i++) { map.dropPin(coordinatesGPS[i].latitude, coordinatesGPS[i].longitude, chest); } }
void LoadData(Coordinates currentLocation) //This is called when the origin is set { Debug.Log("Dropping game object at: " + coordinatesGPS.toLatLongString()); map.dropPin(coordinatesGPS.latitude, coordinatesGPS.longitude, gameObject); }
void Start() { map.dropPin(coordinatesGPS.latitude, coordinatesGPS.longitude, gameObject); transform.Translate(Vector3.up * 15, Space.World); }
internal void OnMakeChestOnLocation(string Chestid, double latitude, double longitude, float FreezeTime) { if (ChestArray == null) { ChestArray = new ArrayList(); } if (ChestObjectArrayList == null) { ChestObjectArrayList = new ArrayList(); } if (AnimationArray == null) { AnimationArray = new ArrayList(); } if (!ChestArray.Contains(Chestid)) { print(Chestid); GameObject instanceObj = (GameObject)Instantiate(prefabs [0]); coordNumber++; instanceObj.transform.SetParent(ChestInsertObject.transform, false); instanceObj.name = prefabs [0].name + "_" + Chestid; instanceObj.GetComponent <ItemAnimation> ().ChestId = Chestid; instanceObj.SetActive(true); instanceObj.GetComponent <ItemAnimation> ().FreezeTime = FreezeTime; instanceObj.GetComponent <ItemAnimation> ().OnStartTImer(FreezeTime); instanceObj.GetComponent <ItemAnimation> ().ChestLocation = new Vector2((float)latitude, (float)longitude); if (Mathf.Approximately((float)coordinates [coordNumber].latitude, 0f)) { coordinates [coordNumber] = new Coordinates( System.Math.Round(LocationManager.CenterWorldCoordinates.latitude + (double)Random.Range(randomMinMax.x, randomMinMax.y), 4), System.Math.Round(LocationManager.CenterWorldCoordinates.longitude + (double)Random.Range(randomMinMax.x, randomMinMax.y), 4), defAltitude); // Debug.Log ("it's 0, lat: "+coordNumber+ " :: "+coordinates [coordNumber].latitude); } map.dropPin(latitude, longitude, instanceObj); Coordinates coordinat = new Coordinates(latitude, longitude, 0); instanceObj.transform.localPosition = coordinat.convertCoordinateToVector(); instanceObj.transform.Translate(Vector3.up * instanceObj.transform.localScale.y / 2f, Space.World); ChestArray.Add(Chestid); ChestObjectArrayList.Add(instanceObj); } else { for (int i = 0; i < ChestObjectArrayList.Count; i++) { GameObject obj = ChestObjectArrayList [i] as GameObject; // if (!AnimationArray.Contains (obj.GetComponent<ItemAnimation> ().ChestId)) { // print ("Chest Id Is Not Found"); // } else if (obj.GetComponent<ItemAnimation> ().ChestId == Chestid) { // // print ("ChestIdIsFound"); // obj.SetActive (true); // obj.GetComponent<ItemAnimation> ().StopAllCoroutines (); if (obj.GetComponent <ItemAnimation> ().ChestId == Chestid & obj.GetComponent <ItemAnimation> ().IsAnimated == false) { if (FreezeTime > 0) { print(FreezeTime + " " + obj.GetComponent <ItemAnimation> ().ChestId); obj.SetActive(false); obj.GetComponent <ItemAnimation> ().FreezeTime = 0; obj.GetComponent <ItemAnimation> ().OnStartTImer(FreezeTime); } else { obj.GetComponent <ItemAnimation> ().FreezeTime = FreezeTime; obj.GetComponent <ItemAnimation> ().OnStartTImer(FreezeTime); print(FreezeTime + " " + obj.GetComponent <ItemAnimation> ().ChestId); } } // } } } }
void LoadData(Coordinates currentLocation) { //This is called when the origin is set map.dropPin(coordinatesGPS.latitude, coordinatesGPS.longitude, gameObject); }