Exemple #1
0
 public void ActivateSkill(UnitBaseBehaviourComponent activateTo)
 {
     activate = true;
     if (!affectedUnits.Contains(activateTo))
     {
         affectedUnits.Add(activateTo);
     }
     activateTo.ReceiveBuff(skillEffect);
 }
Exemple #2
0
        public virtual void OnTriggerEnter(Collider other)
        {
            // IF ITS AOE, WE HAVE ANOTHER SCRIPT FOR THAT (AoeSkillBehaviour)
            if (targetType == TargetType.AOE)
            {
                return;
            }

            // DOES IT INFLICT DAMAGE ON UNIT ONLY ONCE?
            if (other.GetComponent <UnitBaseBehaviourComponent>())
            {
                UnitBaseBehaviourComponent tmp = other.GetComponent <UnitBaseBehaviourComponent>();
                if (tmp == owner)
                {
                    return;
                }
                if (behaviourType == SkillBehaviourType.MovingOneTimeActivated)
                {
                    // Inflict Buff once.
                    if (!affectedUnits.Contains(tmp))
                    {
                        tmp.ReceiveBuff(skillEffect);
                        affectedUnits.Add(tmp);
                    }
                }
                else
                {
                    // Always Inflict Buff
                    tmp.ReceiveBuff(skillEffect);
                    if (!affectedUnits.Contains(tmp))
                    {
                        affectedUnits.Add(tmp);
                    }
                }
            }

            // DOES IT END WITH SINGLE TARGET
            if (targetType == TargetType.SingleTarget)
            {
                GameObject.Destroy(this.gameObject);
            }
        }