void OnTriggerEnter2D(Collider2D Other) { if (Other.tag == "Player") { textDialogue.TryingToLeaveTheBarnDialog(); textDialogue.ActivateTextBox(); textDialogue.StartTyping(); } }
// Update is called once per frame void Update() { if (((Time.time - enteredTime) > beginRain) && raining == false) { rainSource.Play(); raining = true; textDialogue.BarnSceneWasJustLoaded(); textDialogue.ActivateTextBox(); textDialogue.StartTyping(); } if ((Time.time - enteredTime) > beginLightning) { if ((Time.time - lastTime) > minTime) { if (Random.value > threshold) { lightning.color = new Color(1, 1, 1, 0.50f); } else { lightning.color = new Color(1, 1, 1, 0); } lastTime = Time.time; } if ((Time.time - lastTimeLightning) > minTimeLightning) { if (Random.value > lightningThreshold) { source.PlayOneShot(thunder, 1F); } lastTimeLightning = Time.time; } } }