void OnSelectionSet(SM_SelectionChangedEvent ev) { SM_Pawn pawn = ev.Get <SM_Pawn>(); if (pawn != null) { BS_Combatant comb = pawn.GameParent as BS_Combatant; if (comb != null) { SetCombatant(comb); } } }
public void OnSelectionChanged(SM_SelectionChangedEvent ev) { MT_Combatant comb = null; SM_Pawn pawn = ev.Get <SM_Pawn>(); if (pawn != null) { comb = pawn.GameParent as MT_Combatant; if (comb.Team.Team.IsAI) // TODO: change this to compare against current UI player { comb = null; } } SetCombatant(comb); }
void OnSelectionChanged(SM_SelectionChangedEvent ev) { if (Dbg.Assert(ev.NewWho != null)) { return; } MT_Combatant commandable = null; for (int i = 0; commandable == null && i < ev.NewWho.Count; i++) { SM_Pawn t = ev.NewWho[i] as SM_Pawn; if (t != null) { MT_Combatant matchComb = t.GameParent as MT_Combatant; if (matchComb != null) { if (matchComb.Team.Team.IsAI == false) { commandable = matchComb; } } } } if (commandable == _lastCombatant) { return; } _lastCombatant = commandable; ClearAll(); if (commandable != null) { RebuildActionList(commandable); } }