void OnGUI() { if (StartShowMessage) { if (!isShowing) { StartCoroutine(showMessage()); } StartShowMessage = false; } if (GUI.Button(new Rect(Screen.width / 2 - 80, Screen.height - 85, 160, 80), "Clear Targets", skin.GetStyle("Button"))) { message = "Photo Clearedddd"; imageCreater.ClearTexture(); imageManager.ClearAllTarget(); isClear = true; } if (Input.anyKeyDown && !isClear) { //Debug.Log("Input.touchCount1:" + Input.touchCount); message = "Photo Saved"; imageCreater.StartTakePhoto(); } isClear = false; if (isShowing) { GUI.Box(new Rect(Screen.width / 2 - 65, Screen.height / 2, 135, 60), message, skin.GetStyle("Box")); } }
void OnGUI() { if (StartShowMessage) { if (!isShowing) { StartCoroutine(ShowMessageAndLoadTarget()); } StartShowMessage = false; } GUI.Box(new Rect(Screen.width / 2 - 250, 30, 500, 60), "The box area will be used as ImageTarget. Take photo!", skin.GetStyle("Button")); GUI.Box(new Rect(Screen.width / 4, Screen.height / 4, Screen.width / 2, Screen.height / 2), "", skin.GetStyle("Button")); if (isShowing) { GUI.Box(new Rect(Screen.width / 2 - 65, Screen.height / 2, 130, 60), "Photo Saved", skin.GetStyle("Button")); } if (GUI.Button(new Rect(Screen.width / 2 - 80, Screen.height - 85, 160, 80), "Take Photo", skin.GetStyle("Button"))) { imageCreator.ClearTexture(); imageManager.ClearAllTarget(); imageCreator.StartTakePhoto(); } if (GUI.Button(new Rect(Screen.width - 160, Screen.height - 85, 150, 80), "Clear Targets", skin.GetStyle("Button"))) { imageCreator.ClearTexture(); imageManager.ClearAllTarget(); } }
public void onClick(string str) { var imageTargetName_FileDic = imageManager.pathManager.GetDirectoryName_FileDic(); switch (str) { case "home": SceneManager.LoadScene(0); break; case "help": //Menu.isFirst = 4; //SceneManager.LoadScene(0); transform.Find("helpscr").gameObject.SetActive(true); break; case "picture": setTextColor(0, 0); transform.GetChild(3).gameObject.SetActive(true); transform.GetChild(4).gameObject.SetActive(false); imageCreator.ClearTexture(); imageManager.ClearAllTarget(); imageCreator.StartTakePhoto(); break; case "clear": setTextColor(0, 0); transform.GetChild(4).gameObject.SetActive(true); imageCreator.ClearTexture(); imageManager.ClearAllTarget(); break; case "raw": Debug.Log("obj.key => 0~0~" + rawTexture2D); if (rawTexture2D != null) { //Debug.Log("obj.key => 0!1!@"); //foreach (var obj in imageTargetName_FileDic) //{ // Transform tran = GameObject.Find(obj.Key).transform; // tran.GetChild(0).GetChild(0).GetChild(0).GetComponent<Renderer>().material.mainTexture = rawTexture2D; // tran.GetChild(0).GetChild(1).GetChild(0).GetComponent<Renderer>().material.mainTexture = rawTexture2D; // tran.GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetChild(0).GetComponent<Renderer>().material.mainTexture = rawTexture2D; // Debug.Log("tran.GetChild(0).GetChild(0).name = " + tran.GetChild(0).GetChild(0).GetChild(0).name); //} ChangeTexture(rawTexture2D); setTextColor(0, optoinSel); } break; case "embedded": Debug.Log("obj.key => 0~0~" + imageCreator.photo); //if (imageCreator.photo != null) //{ // ChangeTexture(imageCreator.photo); // setTextColor(1,optoinSel); //} StartCoroutine(ImageCreate()); break; case "other": //StartCoroutine(ImageCreate()); texturePanel.gameObject.SetActive(true); break; case "none": foreach (var obj in imageTargetName_FileDic) { Transform tran = GameObject.Find(obj.Key).transform; tran.GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject.SetActive(false); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject.SetActive(false); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject.SetActive(false); Debug.Log("tran.GetChild(0).GetChild(0).name = " + tran.GetChild(0).GetChild(0).GetChild(0).name); setTextColor(finSel, 0); } break; case "illumination": break; case "decoration": setTextColor(finSel, 2); foreach (var obj in imageTargetName_FileDic) { Transform tran = GameObject.Find(obj.Key).transform; tran.GetChild(0).GetChild(0).GetChild(0).GetChild(0).gameObject.SetActive(true); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject.SetActive(true); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetChild(2).gameObject.SetActive(false); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject.SetActive(true); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetChild(0).gameObject.SetActive(angle == 0 && optoinSel == 2); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(0).GetChild(2).gameObject.SetActive(angle != 0 && optoinSel == 2); tran.GetChild(0).GetChild(1).GetChild(0).GetChild(1).GetChild(0).GetChild(0).gameObject.SetActive(angle == 0 && optoinSel == 2); Debug.Log("tran.GetChild(0).GetChild(0).name = " + tran.GetChild(0).GetChild(0).GetChild(0).name); } break; case "help_ok": transform.Find("helpscr").gameObject.SetActive(false); break; } }