void OnUnitHovered(Unit unit) { if (unit.isSelected || !unit.GetModule <FogOfWarModule>().isVisibleInFOW) { return; } Healthbar.SpawnHealthbarForUnit(unit); }
void OnUnitUnhovered(Unit unit) { if (unit.isSelected) { return; } Healthbar.RemoveHealthbarOfUnit(unit); }
void Awake() { selectionGroupText.enabled = false; selfHealthbar = GetComponent <Healthbar>(); totalCarryCellsCount = GameController.instance.MainStorage.carriedUnitsIconsCount; var carryCellTemplate = GameController.instance.MainStorage.carryCellTemplate; for (var i = 0; i < totalCarryCellsCount; i++) { var spawnedCell = Instantiate(carryCellTemplate, carryCellsPanel); carryCells.Add(spawnedCell.GetComponent <CarryCell>()); carryCells[i].SetActive(false); } lockedIconObject.SetActive(false); }