示例#1
0
        public override IEnumerator Trigger(AbilityCastData abilityCastData)
        {
            //Set the animator to be targeting.
            abilityCastData.Animator.SetBool(hashIsTargeting, true);

            //Alert any listeners that we are now getting targets.
            onStartGettingTargets.Raise(targetGetter);

            //Start a coroutine to get targets.
            CoroutineWithData getTargetsCoroutine = new CoroutineWithData(targetGetter.GetTargets());

            yield return(getTargetsCoroutine.Run());

            //Break if we did not get back a list of targets.
            if (!(getTargetsCoroutine.Result is List <ITargetable> targets))
            {
                yield break;
            }

            //Set the currently stored targets to be the targets that were just collected.
            abilityCastData.AbilityActionHandler.CurrentTargets = targets;

            FinishGettingTargets(abilityCastData);
        }