예제 #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && !isPlayed)
     {
         AnimationObject.Play();
         if (AnimationSound)
         {
             Tools.PlayOneShot2D(transform.position, AnimationSound, SoundVolume);
         }
         effects.Scare(ScareLevelSec);
         isPlayed = true;
     }
 }
예제 #2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player" && !isPlayed)
     {
         AnimationObject.Play();
         if (AnimationSound)
         {
             AudioSource.PlayClipAtPoint(AnimationSound, Camera.main.transform.position, SoundVolume);
         }
         effects.Scare(ScareLevelSec);
         isPlayed = true;
     }
 }
예제 #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player" && !isPlayed)
     {
         Box1  = Instantiate(Box, spawnposition.transform.position, Quaternion.identity) as GameObject;
         boxRB = Box1.GetComponent <Rigidbody>();
         boxRB.AddForce(transform.forward * 1000);
         Box1  = Instantiate(Box, spawnposition.transform.position, Quaternion.identity) as GameObject;
         boxRB = Box1.GetComponent <Rigidbody>();
         boxRB.AddForce(transform.forward * 1000);
         if (AnimationSound)
         {
             Tools.PlayOneShot2D(transform.position, AnimationSound, SoundVolume);
         }
         effects.Scare(ScareLevelSec);
         isPlayed = true;
     }
 }