Exemplo n.º 1
0
        public void DoDamageAnimationEvent(AnimationEvent animationEvent)
        {
            AIAttackInfo attackInfo = animationEvent.objectReferenceParameter as AIAttackInfo;
            DamageInfo   damageInfo = new DamageInfo(attackInfo);

            damageInfo.sender = gameObject;

            List <Damageable> damageableList = AttackRaycast(attackInfo);

            SendDamageEvent(damageableList, damageInfo);
        }
Exemplo n.º 2
0
        private List <Damageable> AttackRaycast(AIAttackInfo attackInfo)
        {
            RaycastHit[] hitArray = Physics.RaycastAll(AttackRay, attackInfo.range, hitLayer.value, QueryTriggerInteraction.Ignore);

            if (attackInfo.multipleTargets)
            {
                return(HandleMultipleTargetsRaycast(hitArray));
            }
            else
            {
                return(HandleSingleTargetRaycast(hitArray));
            }
        }