Example #1
0
        private void AttackThief()
        {
            DeathmatchAgent  agent            = GetComponentInParent <DeathmatchAgent>();
            PatrolController patrolController = GetComponentInParent <PatrolController>();

            agent.TrackLayerAndTag(m_InteractorGameObject.layer, m_InteractorGameObject.tag);
            patrolController.CheckAlarm(m_InteractorGameObject);
        }
Example #2
0
        /// <summary>
        /// Override Damage to add an extra damage amount depending on the bone hit.
        /// </summary>
        /// <param name="amount">The amount of damage taken.</param>
        /// <param name="position">The position of the damage.</param>
        /// <param name="force">The amount of force applied to the object while taking the damage.</param>
        /// <param name="radius">The radius of the explosive damage. If 0 then a non-exposive force will be used.</param>
        /// <param name="attacker">The GameObject that did the damage.</param>
        public override void Damage(float amount, Vector3 position, Vector3 force, float radius, GameObject attacker, GameObject hitGameObject)
        {
            if (deathmatchAgent != null)
            {
                deathmatchAgent.TrackLayerAndTag(attacker.layer, attacker.tag);
            }
            base.Damage(amount, position, force, radius, attacker, hitGameObject);

            if (amount > 0)
            {
                OnCharacterDamaged?.Invoke(this, amount, position, attacker.transform.position);
            }
        }