private IEnumerator ActiveObject(float time, string other) { yield return(new WaitForSeconds(time)); if (gObj != null) { gObj.SetActive(true); ThrowDialog dialog = gObj.GetComponent <ThrowDialog>(); if (dialog != null) { dialog.ThrowDialogNow(); } } foreach (GameObject g in secundaryObjects) { g.SetActive(true); } Image img = gObj.GetComponent <Image>(); if (img != null) { img.sprite = Resources.Load <Sprite>(other); } }
/// <summary> /// move the camera /// </summary> private void moveCamera() { CameraScroll cam = sceneCamera.GetComponent <CameraScroll>(); cam.scroll_min = minScroll; cam.scroll_max = maxScroll; sceneCamera.transform.localPosition = new Vector3(x, y, sceneCamera.transform.localPosition.z); if (throwMyDialog) { ThrowDialog t = this.gameObject.GetComponent <ThrowDialog>(); if (t) { t.ThrowDialogNow(); } } }
private IEnumerator DeactiveObject(float time) { yield return(new WaitForSeconds(time)); if (gObj != null) { gObj.SetActive(false); ThrowDialog dialog = gObj.GetComponent <ThrowDialog>(); if (dialog != null) { dialog.ThrowDialogNow(); } } foreach (GameObject g in secundaryObjects) { g.SetActive(false); } }