public void LoadShapesJSON(JToken mapMetadata) { if (!shapesLoaded) { shapesLoaded = true; Debug.Log("LOADING SHAPES>>>"); if (mapMetadata is JObject && mapMetadata ["shapeList"] is JObject) { ShapeList shapeList = mapMetadata ["shapeList"].ToObject <ShapeList> (); if (shapeList.shapes == null) { Debug.Log("no shapes dropped"); return; } foreach (var shapeInfo in shapeList.shapes) { shapeInfoList.Add(shapeInfo); GameObject shape = ShapeFromInfo(shapeInfo); shapeObjList.Add(shape); } if (navController != null) { navController.InitializeNavigation(); } } } }
IEnumerator PrepareNode() { shapeManager.CreateNode(); yield return(new WaitUntil(() => shapeManager.nodeLoaded == true)); if (destination != null) { navController.InitializeNavigation(); } shapeManager.nodeLoaded = false; }
void OnDestSelected(NodeShape dest) { if (navController != null) { navController.InitializeNavigation(); } navController.SetInitialized(false); navController.SetComplete(false); navController.InitNav(dest.id); destList.SetActive(false); resetButton.SetActive(true); navigationButton.GetComponentInChildren <Text>().text = "เลือกสถานที่"; statusText.text = "นำทางไปยัง " + dest.name; }
public void LoadShapesJSON(JToken mapMetadata, string selectedDestination) { if (!shapesLoaded) { shapesLoaded = true; Debug.Log("LOADING SHAPES>>>"); if (mapMetadata is JObject && mapMetadata ["shapeList"] is JObject) { ShapeList shapeList = mapMetadata ["shapeList"].ToObject <ShapeList> (); if (shapeList.shapes == null) { Debug.Log("no shapes dropped"); return; } foreach (var shapeInfo in shapeList.shapes) { Debug.Log(shapeInfo.label + " is loaded"); if (shapeInfo.label != selectedDestination && shapeInfo.shapeType == 1) { Debug.Log("Change type : " + shapeInfo.label); shapeInfo.shapeType = 0; } shapeInfoList.Add(shapeInfo); GameObject shape = ShapeFromInfo(shapeInfo); shapeObjList.Add(shape); } if (navController != null) { navController.InitializeNavigation(); } } } }