Exemple #1
0
 /// <summary>Will Send Damage to the Hit</summary>
 public virtual void TestHit(RaycastHit other)
 {
     if (other.transform)
     {
         if (other.rigidbody && AffectRigidBodies)
         {
             other.rigidbody.AddForceAtPosition(transform.forward * force, other.point);
         }
     }
     OnHitTarget.Invoke(other);
 }
Exemple #2
0
        /// <summary>
        /// Will Send
        /// </summary>
        /// <param name="other"></param>
        public virtual void TestHit(RaycastHit other)
        {
            DamageValues DV = new DamageValues(-transform.forward, damage);

            if (other.transform)
            {
                other.transform.SendMessageUpwards("getDamaged", DV, SendMessageOptions.DontRequireReceiver);

                if (other.rigidbody && AffectRigidBodies)
                {
                    other.rigidbody.AddForceAtPosition(transform.forward * force, other.point);
                }
            }
            OnHitTarget.Invoke(other);
        }