예제 #1
0
        public void HitObject(GameObject g)
        {
            var health = g.GetComponent <Health>();

            if (health != null)
            {
                health.Impact(Damage, transform.forward * ImpactForce, raySensor.GetRayHit(g).point);
            }
            explode(raySensor.GetRayHit(g).normal);
        }
예제 #2
0
        public void HitObject(GameObject g)
        {
            var health = g.GetComponent <newHealth>();
            var damage = Random.Range(damageMin, damageMax);

            if (health != null)
            {
                health.Impact(damage, transform.forward * ImpactForce, raySensor.GetRayHit(g).point, fromIndex);
            }
            explode(raySensor.GetRayHit(g).normal);
        }