Ejemplo n.º 1
0
 void OnUnitClick(FightUnitPoint unit)
 {
     if (curUnit == null)
     {
         return;
     }
     if (!curUnit.IsHeroUnit)
     {
         return;
     }
     if (curUnit.TryAction(unit))
     {
         ChangeTurn();
     }
 }
Ejemplo n.º 2
0
    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();
    }