Example #1
0
 private void ResolveEnemyEffects(TargetableObject instigator, List <Effect> effects)
 {
     foreach (var effect in effects)
     {
         if (effect is TargetableEffect targetableEffect)
         {
             var targets = GetTargets(targetableEffect.Target, instigator);
             foreach (var target in targets)
             {
                 targetableEffect.Resolve(instigator, target);
             }
         }
     }
 }
Example #2
0
        /// <summary>
        /// 检测点击敌人
        /// </summary>
        private void DetectEnemySelection()
        {
            if (SelectedCard == null || !cardHasTargetable)
            {
                return;
            }
            var mousePos = MainCamera.ScreenToWorldPoint(Mouse.current.position.ReadValue());
            var hitInfo  = Physics2D.Raycast(mousePos, Vector3.forward, Mathf.Infinity, EnemyLayer);

            if (hitInfo.collider != null)
            {
                selectEnemy = hitInfo.collider.GetComponent <TargetableObject>();
                PlaySelectedCard();

                SelectedCard = null;

                isArrowCreated = false;
                _targetingArrow.EnableArrow(false);
            }
        }
Example #3
0
 public override void Resolve(TargetableObject instigator, TargetableObject target)
 {
     GameEntry.Event.FireNow(this, DrawnCardEventArgs.Create(Value));
 }
Example #4
0
 public override void Resolve(TargetableObject instigator, TargetableObject target)
 {
 }