private void OnTriggerEnter(Collider other) { if (other.gameObject.layer == 9) { if (!redOrbIntroductionStarted) { redOrbIntroductionStarted = true; companion.SetAutoFollow(false); companion.MoveTo(companionPosition.position); StartCoroutine(Introduction()); } } }
private void OnCollisionEnter(Collision collision) { if ((dontLeaveSplatsOn & 1 << collision.gameObject.layer) == 1 << collision.gameObject.layer) //if it collides with "dontLeaveSplatsOn"-layer it bounces off { return; } Splat(collision); AudioSource.PlayClipAtPoint(splashSound, transform.position, 35.0f); companion.MoveTo(collision.contacts[0].point); Destroy(gameObject); }
private IEnumerator FinishSpeaking() { float delay = 1.0f; companion.SetAutoFollow(false); companion.SetIdle(false); companion.MoveTo(companionPosition.position); yield return(new WaitForSeconds(3.0f)); companion.StartSpeaking(audioClips[0]); yield return(new WaitForSeconds(audioClips[0].length + delay)); yield return(new WaitForSeconds(7.0f)); companion.StartSpeaking(audioClips[1]); yield return(new WaitForSeconds(audioClips[1].length + delay)); SteamVR_Fade.Start(Color.black, 3.0f); yield return(null); }