public void setTarget(Unit target, bool isAIReveal = false) { if (doingAIReveal && !isAIReveal) { return; } targetUnit = GameObjectManager.instance.findUnitGO(target); usingTargetTile = false; freeControl = false; }
public void setTarget(TilePos target, bool isAIReveal = false) { if (doingAIReveal && !isAIReveal) { return; } targetUnit = null; usingTargetTile = true; targetTile = new TilePos(target); freeControl = false; }
public UnitGO getUnitGO() { //check if we have any inactive in the list for (int i = 0; i < units.Count; i++) { if (units [i].IsActive == false) { return(units [i]); } } //otherwise make one GameObject obj = Instantiate(unitPrefab) as GameObject; UnitGO GO = obj.GetComponent <UnitGO> (); units.Add(GO); return(GO); }