// If this collides with DeadDimension, turn it "on" and play any narration void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "DeadDimension") { if (other.bounds.Contains(top) && other.bounds.Contains(middle) && other.bounds.Contains(bottom)) { //let the rift know we need to know when it's gone RiftMeshManager.AddDeadObject(this); //read the narration once if (narrationReady == true) { Narration.Narrate(narrationClip); narrationReady = false; } //make changes to the scene in response to this being revealed if (toggleA != null) { toggleA.SetActive(true); } if (toggleB != null) { toggleB.SetActive(false); } } } }
// Tries to open a rift when we stop drawing void OnRelease() { //create mesh if there was a collision if (loopEnd - loopStart > 5) { RiftMeshManager.Create(loopStart, loopEnd, points); } //destroy the game object 6 seconds after drawing Destroy(theTrail, 6); ClearTrail(); drawing = false; }