Beispiel #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.layer == CommonValue.Layers.Attack)
     {
         AttackBox attackBox = other.gameObject.GetComponent <AttackBox>();
         if (attackBox && ReferenceEquals(attackBox.Attack.Target, damageableObject))
         {
             attackBox.Ineffective();
             damageableObject.ReceiveDamage(UnityRandom.value * 3.0f);
         }
     }
 }
Beispiel #2
0
        private bool IsAttackAgainstMe(GameObject gameObject, out AttackAction attack)
        {
            AttackBox attackBox = gameObject.GetComponent <AttackBox>();

            if (attackBox && attackBox.Attack.SourceEntity.TargetedEnemy == entityCombatController)
            {
                attack = attackBox.Attack;
                return(true);
            }

            attack = null;
            return(false);
        }
Beispiel #3
0
 public AttackAction(OffensiveActionData data, AttackBox attackBox) : base()
 {
     ActionData = data;
     AttackBox  = attackBox;
 }