Пример #1
0
 void OnTriggerEnter(Collider other)
 {
     if ("Player".Equals(other.tag))
     {
         var normalizedHp = _theDaystar.GetNormalizeHp();
         var damage       = normalizedHp <= (1f / 7f) ?
                            (theTraitor.isTraitor ? 7 : 3) :
                            (theTraitor.isTraitor ? 5 : 1);
         other.GetComponent <TheShepherd> ().Hit(damage);
         _shakeCamera.Shake(.175f, .065f);
         InstantiateEffectAtCollision();
         InstantiateSoundEffectAtCollision();
         if (theTraitor.isTraitor)
         {
             theTraitor.InstantiateBullet(300f);
         }
         Destroy(gameObject);
     }
     else if ("The House".Equals(other.tag))
     {
         InstantiateEffectAtCollision();
         InstantiateSoundEffectAtCollision();
         Destroy(gameObject);
     }
     else if ("The Word".Equals(other.tag))
     {
         other.GetComponent <ThePrayerWord> ().SelfDestruct();
     }
 }
Пример #2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         other.GetComponent <TheShepherd> ().Hit(damage);
         _shakeCamera.Shake(.175f, .065f);
         InstantiateEffectAtCollision();
         InstantiateSoundEffectAtCollision();
         if (theTraitor.isTraitor)
         {
             theTraitor.InstantiateBullet(300f);
         }
         Destroy(gameObject);
     }
     else if (other.tag == "The House")
     {
         StartCoroutine(Disappear());
     }
     else if (other.tag == "The Word")
     {
         other.GetComponent <ThePrayerWord> ().SelfDestruct();
     }
 }