public override void Update() { if (ClickFlag == true) { Thunderbolt_X = 0; List <Creature> CList = Land.GetCList(clickPosition); foreach (Creature creature in CList) { creature.HP = 0; } ClickFlag = false; } }
public override void Update() { if (ClickFlag == true) { float temDistance = 10000;//同エリア内でのカーソルと生物との暫定最短距離 List <Creature> CList = Land.GetCList(clickPosition); foreach (Creature creature in CList.Where(x => x.Alive)) { Vector2D creaturePos = clickPosition - creature.Position; if (temDistance > creaturePos.SquareLength) { temDistance = creaturePos.SquareLength; Object = creature; } } ClickFlag = false; } }