Exemplo n.º 1
0
    void Right_UpdateBarracksSlot(BuildingCore.Barracks target)
    {
        Transform fill = Right_GetUISubmenuBuilding(0).GetChild(0).GetChild(0).GetChild(1);

        if (target.ownedUnit.generationTime == 0 | target.ownedUnit.generationTime == 16)
        {
            if (target.ownedUnit.queued == TroopCore.Type.None)
            {
                fill.GetChild(1).GetComponent <TextMeshProUGUI>().text = "";
                fill.GetComponent <Image>().fillAmount = 0;
            }
            else
            {
                fill.GetChild(1).GetComponent <TextMeshProUGUI>().text = "Queued";
                fill.GetComponent <Image>().fillAmount = 1;
            }
        }
        else
        {
            fill.GetChild(1).GetComponent <TextMeshProUGUI>().text = target.ownedUnit.generationTime.ToString("F1");
            fill.GetComponent <Image>().fillAmount = target.ownedUnit.generationTime / 15;
        }
    }
Exemplo n.º 2
0
 void OnEnable()
 {
     barracks = (BuildingCore.Barracks)target;
 }