private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player") { scene.newDay(); Destroy(gameObject); } }
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]; } } } } }
public void Interaction() { scene.newDay(); }