Example #1
0
 // 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);
             }
         }
     }
 }
 // Play the sudio source's sound when the player touches this, then disable the collider
 void OnTriggerEnter(Collider other)
 {
     if (narrationReady == true && other.gameObject.tag == "Player")
     {
         Narration.Narrate(narrationClip);
         narrationReady = false;
     }
 }
Example #3
0
 // Plays the start narration once, if possible
 public void playStartNarration()
 {
     if (startNarrationReady == true)
     {
         Narration.Narrate(startNarrationClip);
         startNarrationReady = false;
     }
 }
Example #4
0
 // Plays the exit narration once, if possible
 public void PlayExitNarration()
 {
     if (exitNarrationReady == true)
     {
         Narration.Narrate(exitNarrationClip);
         exitNarrationReady = false;
     }
 }
Example #5
0
 // Plays the pickup narration if possible
 public void PlayPickupNarration()
 {
     if (pickupNarrationReady == true)
     {
         Debug.Log("cool key");//test
         Narration.Narrate(pickupNarrationClip);
         pickupNarrationReady = false;
     }
 }
Example #6
0
    /* A method that moves the camera to a new location within the scene */
    public void MoveTo(Transform newPosition)
    {
        float step = moveSpeed * Time.deltaTime; // calculate distance to move

        while (Vector3.Distance(transform.position, newPosition.position) >= 1.00f)
        {
            transform.position = Vector3.MoveTowards(transform.position, newPosition.position, step);
        }
        narrationText.Narrate();
    }
 private void OnTriggerEnter(Collider other)
 {
     //only activate when the player is near
     if (other.gameObject.tag == "Player")
     {
         material.color = Color.green;
         interactable   = true;
         //play narration if possible
         if (nearbyNarrationReady == true)
         {
             Narration.Narrate(nearbyNarrationClip);
             nearbyNarrationReady = false;
         }
     }
 }