Exemple #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            scene.newDay();

            Destroy(gameObject);
        }
    }
Exemple #2
0
    public void Interaction()
    {
        if (scene.actualPhase == SceneControlle.Phase.DAY)
        {
            if (dialogueLine < timesSpoke[scene.day / 2])
            {
                texto.text = dialogues[dialogue];

                dialogueLine++;
                dialogue++;

                actualTalkingTime = Time.time + talkingTime;
            }
            else
            {
                if (bocadillo.gameObject.activeSelf)
                {
                    bocadillo.gameObject.SetActive(false);


                    if (dialogue >= dialogues.Length)
                    {
                        SceneManager.LoadScene("MenuScene");
                    }

                    dialogueLine = 0;

                    if (merchant)
                    {
                        scene.newDay();
                    }
                    else
                    {
                        dialogue -= timesSpoke[scene.day / 2];
                    }
                }
            }
        }
        else
        {
            if (dialogueLine < timesSpoke[(scene.day - 1) / 2])
            {
                texto.text = dialogues[dialogue];

                dialogueLine++;
                dialogue++;

                actualTalkingTime = Time.time + talkingTime;
            }
            else
            {
                if (bocadillo.gameObject.activeSelf)
                {
                    bocadillo.gameObject.SetActive(false);


                    dialogueLine = 0;

                    if (merchant)
                    {
                        scene.newDay();
                    }
                    else
                    {
                        dialogue -= timesSpoke[(scene.day - 1) / 2];
                    }
                }
            }
        }
    }
Exemple #3
0
 public void Interaction()
 {
     scene.newDay();
 }