예제 #1
0
    /// <summary>
    /// Used to enable the Agent's purchasing after his cooldown is gone
    /// </summary>
    private void Reset(UnitInCd unitInCd)
    {
        UnitButton unitButton = unitInCd.unitButton;

        unitButton.unit.isInCD         = false;
        unitButton.cdFillText.enabled  = false;
        unitButton.cdFillImage.enabled = false;

        unitsInCD.Remove(unitInCd);

        UpdateButtons();
    }
예제 #2
0
    /// <summary>
    /// Call when button as been pressed, and set a cooldown on the button
    /// </summary>
    public void Cooldown(UnitButton unitButton)
    {
        // fill the image to start animation cd
        unitButton.cdFillImage.fillAmount = 1;

        unitButton.unit.isInCD = true;

        UnitInCd unitInCd = new UnitInCd();

        unitInCd.unitButton = unitButton;
        unitInCd.unitCd     = unitButton.unit.cDBetweenSpawns;

        unitsInCD.Add(unitInCd);
    }