コード例 #1
0
    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);
        }
    }
コード例 #2
0
    /// <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();
            }
        }
    }
コード例 #3
0
    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);
        }
    }