void OnUnitClick(FightUnitPoint unit) { if (curUnit == null) { return; } if (!curUnit.IsHeroUnit) { return; } if (curUnit.TryAction(unit)) { ChangeTurn(); } }
public static void MoveAI(FightUnitPoint selectedUnit, List <FightUnitPoint> enemyList, System.Action onMove) { System.Action waitMove = () => { Thread.Sleep(waitTimeMs); Threading.Execute(delegate { selectedUnit.TryAction(enemyList.Find((FightUnitPoint unit) => unit.Squad != null)); onMove.Invoke(); }); }; Thread waitThread = new Thread(new ThreadStart(waitMove)); waitThread.Start(); }