示例#1
0
        public void RegisterHit(Collider hit)
        {
            GameObject other = hit.gameObject;

            if (other.CompareTag("Player") || other.CompareTag("ProjectileShield"))
            {
                if (ebFound)
                {
                    eb.ApplyDamage(recoilDamage);
                }

                lm.IncrementHealth(playerDamage); //decreases health by passing in a negative
                lm.CollectPollen(pollenLoss);     //decreases pollen by passing in a negative

                if (hitSfx != null)
                {
                    AudioSource.PlayClipAtPoint(hitSfx, other.transform.position);
                }
            }
            else if (other.CompareTag("Hive"))
            {
                if (ebFound)
                {
                    eb.ApplyDamage(recoilDamage);
                }

                hm.IncrementHealth(hiveDamage);
            }
        }