Exemple #1
0
    public void onChildrenTouched(string name)
    {
        switch (name)
        {
        case "yesBtn":
            Debug.Log("Yes clicked");
            gameObject.audio.Play();
            playerOption = true;
            break;

        case "noBtn":
            Debug.Log("No clicked");
            gameObject.audio.Play();
            playerOption = false;
            break;
        }



        Destroy(dialogInstance);
        onFinish();
        dialogisOn = false;
        occupied   = false;
        GamePause.continueGame();
    }
Exemple #2
0
    IEnumerator  wait1Sec()
    {
        GamePause.pauseGame();
        yield return(new WaitForSeconds(0.7f));

        GamePause.continueGame();
        if (!SaveLoadSystem.getInstance().labSceneStateArr [(int)SaveLoadSystem.LabSceneState.BEGANDIALOG])
        {
            StartCoroutine("startBeginningDialog");
        }
        else
        {
            StartCoroutine("startLoopHint1");
        }
    }
Exemple #3
0
 public void closePanel()
 {
     GamePause.continueGame();
     gameObject.SetActiveRecursively(false);
 }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     GamePause.continueGame();
 }
Exemple #5
0
    // Update is called once per frame
    void Update()
    {
        if (!occupied)
        {
            if (bufferedDialog.Count != 0)
            {
                DialogGroup dg = bufferedDialog.Dequeue();
                switch (dg.type)
                {
                case 3:
                    startShowBigIcon(dg.nameString, dg.contentString, dg.di, dg.id, dg.sprite);
                    break;

                case 2:
                    startOptionDialog(dg.nameString [0], dg.contentString [0], dg.di, dg.id);
                    break;

                case 1:
                    startDialogs(dg.nameString, dg.contentString, dg.di, dg.id);
                    break;
                    return;
                }
            }
        }

        if (!dialogisOn)
        {
            if (toCreateDialog)
            {
                CreateDialog();
                toCreateDialog = false;
                dialogisOn     = true;
            }
        }
        if (dialogisOn)
        {
            if (waitForClick)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    if (!option_Mode)
                    {
                        isClick = true;
                    }
                }
            }
            if (isClick)
            {
                gameObject.audio.Play();
                if (cdialogString.Count > 0)
                {
                    dialogInstance.transform.GetChild(1).GetComponent <TextMesh> ().text = cnameString.Dequeue();
                    dialogInstance.transform.GetChild(2).GetComponent <TextMesh> ().text = cdialogString.Dequeue();
                    //charaterpic

                    if (pic [0] == nameString [nameString.Length - dialog_counter])
                    {
                        if (dialogInstance.transform.GetChild(3).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(3).renderer.material.color = new Color(dialogInstance.transform.GetChild(3).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.b, 1f);
                        }
                        if (dialogInstance.transform.GetChild(4).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(4).renderer.material.color = new Color(dialogInstance.transform.GetChild(4).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.b, 0.3f);
                        }
                    }
                    else if (pic [1] == nameString [nameString.Length - dialog_counter])
                    {
                        if (dialogInstance.transform.GetChild(3).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(3).renderer.material.color = new Color(dialogInstance.transform.GetChild(3).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.b, 0.3f);
                        }
                        if (dialogInstance.transform.GetChild(4).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(4).renderer.material.color = new Color(dialogInstance.transform.GetChild(4).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.b, 1f);
                        }
                    }
                    else
                    {
                        if (dialogInstance.transform.GetChild(3).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(3).renderer.material.color = new Color(dialogInstance.transform.GetChild(3).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(3).renderer.material.color.b, 0.3f);
                        }
                        if (dialogInstance.transform.GetChild(4).GetComponent <SpriteRenderer> ().sprite != null)
                        {
                            dialogInstance.transform.GetChild(4).renderer.material.color = new Color(dialogInstance.transform.GetChild(4).renderer.material.color.r,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.g,
                                                                                                     dialogInstance.transform.GetChild(4).renderer.material.color.b, 0.3f);
                        }
                    }

                    dialog_counter--;

                    waitForClick = true;
                    isClick      = false;
                }
                else
                {
                    Destroy(dialogInstance);

                    onFinish();
                    dialogisOn = false;
                    occupied   = false;
                    GamePause.continueGame();
                }
            }
        }
    }