void Update() { if (dataFromGUI != null) { string guiCmd = dataFromGUI.Split('|')[0].ToUpper().Trim(); string guiParam = dataFromGUI.Split('|')[1].Trim(); dataFromGUI = null; // Unity3D -> GUI 명령어 전송 if (guiCmd.Equals("OPEN")) { mainFuncs.ShortLoad(guiParam); // GUI -> Unity3D 로 데이터 전송 // 1. IndoorGML 객체 리스트를 확보 // 2. 내부규칙에 따른 문자열 형태로 dataToGUI 생성 // Root // ㄴCellSpace // ㄴGeneralSpace // ㄴCellSpaceBoundary // ㄴState // ㄴTransition //StringBuilder sb = new StringBuilder(); mainFuncs.DoMoveViewPoint(1); // Unity3D에서 Tree갱신을 기다려 준다. StartCoroutine(DelayAndUpdateTree()); } else if (guiCmd.Equals("SHOW")) { string[] showObjects = guiParam.Split(' '); if (showObjects.Length == 1 && ( showObjects[0].Equals(CommonNames.ROOT_CELLSPACE) || showObjects[0].Equals(CommonNames.ROOT_CELLSPACEBOUNDARY) || showObjects[0].Equals(CommonNames.ROOT_GENERALSPACE) || showObjects[0].Equals(CommonNames.ROOT_STATE) || showObjects[0].Equals(CommonNames.ROOT_TRANSITION) || showObjects[0].Equals(CommonNames.ROOT_TRANSITIONSPACE))) { var root = GameObject.Find(showObjects[0].TrimEnd()).transform; for (int i = 0; i < root.childCount; i++) { ShowObject(root.GetChild(i).gameObject); } } else { foreach (string id in showObjects) { ShowObject(id); } } } else if (guiCmd.Equals("HIDE")) { string[] hideObjects = guiParam.Split(' '); if (hideObjects.Length == 1 && ( hideObjects[0].Equals(CommonNames.ROOT_CELLSPACE) || hideObjects[0].Equals(CommonNames.ROOT_CELLSPACEBOUNDARY) || hideObjects[0].Equals(CommonNames.ROOT_GENERALSPACE) || hideObjects[0].Equals(CommonNames.ROOT_STATE) || hideObjects[0].Equals(CommonNames.ROOT_TRANSITION) || hideObjects[0].Equals(CommonNames.ROOT_TRANSITIONSPACE))) { var root = GameObject.Find(hideObjects[0].TrimEnd()).transform; for (int i = 0; i < root.childCount; i++) { HideObject(root.GetChild(i).gameObject); } } else { foreach (string id in hideObjects) { HideObject(id); } } } else if (guiCmd.Equals("GOTO")) { SelectObject(guiParam, true); } else if (guiCmd.Equals("SELECT")) { SelectObject(guiParam, false); } else if (guiCmd.Equals("VIEW")) { if (guiParam.Equals("ORTHOGONAL")) { Camera.main.orthographic = true; Camera.main.nearClipPlane = -1000; } else if (guiParam.Equals("PERSPECTIVE")) { Camera.main.orthographic = false; Camera.main.nearClipPlane = 0.3f; } else { mainFuncs.DoMoveViewPoint(Convert.ToInt32(guiParam)); } } else if (guiCmd.Equals("STATE")) { mainFuncs.UpdateStatesSize(Convert.ToSingle(guiParam)); } else if (guiCmd.Equals("CULLOFF")) { if (guiParam.Equals(CommonNames.ROOT_CELLSPACE)) { mainFuncs.CellSpaceBackFaceCulling(false); } else if (guiParam.Equals(CommonNames.ROOT_GENERALSPACE)) { mainFuncs.GeneralSpaceBackFaceCulling(false); } else if (guiParam.Equals(CommonNames.ROOT_TRANSITIONSPACE)) { mainFuncs.TransitionBackFaceCulling(false); } else if (guiParam.Equals(CommonNames.ROOT_CELLSPACEBOUNDARY)) { mainFuncs.CellSpaceBoundaryBackFaceCulling(false); } } else if (guiCmd.Equals("CULLON")) { if (guiParam.Equals(CommonNames.ROOT_CELLSPACE)) { mainFuncs.CellSpaceBackFaceCulling(true); } else if (guiParam.Equals(CommonNames.ROOT_GENERALSPACE)) { mainFuncs.GeneralSpaceBackFaceCulling(true); } else if (guiParam.Equals(CommonNames.ROOT_TRANSITIONSPACE)) { mainFuncs.TransitionBackFaceCulling(true); } else if (guiParam.Equals(CommonNames.ROOT_CELLSPACEBOUNDARY)) { mainFuncs.CellSpaceBoundaryBackFaceCulling(true); } } } }