Ejemplo n.º 1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.S))
     {
         Entity.DoDamage(Entity, Entity.Health);
     }
 }
Ejemplo n.º 2
0
        protected virtual void OnCollisionEnter(Collision collision)
        {
            if (collision.gameObject != Level.Current.Castle.gameObject)
            {
                if (Entity.DoDamage(collision.gameObject, damage, Damager))
                {
                }
            }

            Destroy(gameObject);
        }
        protected virtual void OnCollisionEnter(Collision collision)
        {
            var target = collision.gameObject.GetComponent <Entity>();

            if (target == null)
            {
                return;
            }

            Entity.DoDamage(target, 20f);
            Entity.DoDamage(Entity, Entity.Health);
        }
Ejemplo n.º 4
0
        protected virtual void OnCollisionEnter(Collision collision)
        {
            if (collision.gameObject == References.Level.Castle.gameObject)
            {
                Entity.DoDamage(collision.gameObject, damage, AI);

                if (suicideOnHit)
                {
                    Entity.DoDamage(Entity, int.MaxValue, AI);
                }
            }
        }