Ejemplo n.º 1
0
        void OnUnitHovered(Unit unit)
        {
            if (unit.isSelected || !unit.GetModule <FogOfWarModule>().isVisibleInFOW)
            {
                return;
            }

            Healthbar.SpawnHealthbarForUnit(unit);
        }
Ejemplo n.º 2
0
        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);
        }