Example #1
0
    public void UpdateView(SystemElementController elementController, int actionPoints)
    {
        var systemElement = elementController.SystemElement;

        bool buttonState = actionPoints >= systemElement.HackCost && elementController.CanPerformAction;

        hackButton.SetEnabled(buttonState);
        buttonState = actionPoints >= systemElement.DestroyCost && elementController.CanPerformAction;
        destroyButton.SetEnabled(buttonState);
    }
Example #2
0
    private void UpdateView()
    {
        nameText.text = systemElement.Name;

        playerImage.color   = systemElement.OwnerVirus.Color;
        playerText.text     = systemElement.OwnerVirus.Name;
        unhackCostText.text = systemElement.UnhackCost.ToString();

        if (virus.Value == systemElement.OwnerVirus)
        {
            DisableUnhacking();
        }
        else
        {
            bool state = virus.Value.ActionPoints >= systemElement.UnhackCost && elementController.CanPerformAction;
            unhackButton.SetEnabled(state);
            EnableUnhacking();
        }
    }