Esempio n. 1
0
    IEnumerator ReturnAndText(DialogoManager diag, int level)
    {
        yield return(new WaitForSeconds(4));

        if (doorNumber == 1)
        {
            returnToPos1 = true;
        }
        else if (doorNumber == 2)
        {
            returnToPos2 = true;
        }
        else if (doorNumber == 3)
        {
            returnToPos3 = true;
        }
        yield return(new WaitForSeconds(3));

        StartCoroutine(diag.DialogoChange());
    }
Esempio n. 2
0
    void GoMiddle()
    {
        water.level = Global.actualLevel;
        if ((this.transform.position - midAnim[x].transform.position).magnitude < 0.1f)
        {
            if (x < 3)
            {
                x++;
            }
            else
            {
                speed = 9;
                if (Global.actualLevel == 1 || PlayerPrefs.GetInt("SetSpawnHub") == 1)
                {
                    canGoAfterLevel1 = true;
                    StartCoroutine(dialogo7.DialogoChange());
                }
                if (Global.actualLevel == 2 || PlayerPrefs.GetInt("SetSpawnHub") == 2)
                {
                    canGoAfterLevel2 = true;
                    StartCoroutine(dialogo10.DialogoChange());
                }

                if (Global.actualLevel == 3 || PlayerPrefs.GetInt("SetSpawnHub") == 3)
                {
                    canGoAfterLevel2 = true;
                    StartCoroutine(dialogo14.DialogoChange());
                }

                goMiddle = false;
            }
        }
        else
        {
            speed = 10;
            transform.position = Vector3.MoveTowards(transform.position, midAnim[x].transform.position, speed * Time.deltaTime);
        }
    }