Exemple #1
0
    public void StartDialogView()
    {
        //string sceneName = SceneManager.GetActiveScene().name;
        string[] temp = new string[] { "", "" };

        //Debug.Log("Test1");
        DialogPrefab.SetActive(true);

        if (DialogName.Equals(""))
        {
            Debug.Log("DialogName = null on " + gameObject.name);
            DialogPrefab.SetActive(false);
            return;
        }
        else
        {
            Dialog     = new Texts(DialogName);
            DialogUnit = Dialog.GetUnit();
            //temp = DialogUnit.ReturnDialog();
            if (!isRandom)
            {
                temp = DialogUnit.ReturnDialog();
            }
            else
            {
                temp = DialogUnit.ReturnRandomDialog();
            }
        }

        SetFalseAll();

        if (temp[0].Equals(""))
        {
            if (temp[1].Equals(""))  //DialogPrefabOff
            {
                DialogPrefab.SetActive(false);
                return;
            }
            if (temp[1].Length > 4 && temp[1].Substring(0, 4).Equals("@SC@")) //MonologSC
            {
                SCGO.SetActive(true);
                MonologSC.SetActive(true);
                MonologSCText.text = temp[1].Substring(4);
                return;
            }
            else   //MonologGT
            {
                GTGO.SetActive(true);
                MonologGT.SetActive(true);
                MonologGTText.text = temp[1];
                return;
            }
        }
        else
        {
            if (temp[1].Equals("")) //MonologET
            {
                ETGO.SetActive(true);
                MonologET.SetActive(true);
                MonologETText.text = temp[0];
                return;
            }
            if (temp[1].Length > 4 && temp[1].Substring(0, 4).Equals("@SC@")) //SCETDialog
            {
                SCGO.SetActive(true);
                ETGO.SetActive(true);
                SCETDialog.SetActive(true);
                SCETDialogSCText.text = temp[1].Substring(4);
                SCETDialogETText.text = temp[0];
                return;
            }
            else   //MainDialog
            {
                GTGO.SetActive(true);
                ETGO.SetActive(true);
                MainDialog.SetActive(true);
                MainDialogGTText.text = temp[1];
                MainDialogETText.text = temp[0];
                return;
            }
        }
    }