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); } } } }
/// <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); } }
public override void Resolve(TargetableObject instigator, TargetableObject target) { GameEntry.Event.FireNow(this, DrawnCardEventArgs.Create(Value)); }
public override void Resolve(TargetableObject instigator, TargetableObject target) { }