Beispiel #1
0
    public void BuyIntelligence()
    {
        myFavour.currentFavour -= COST;

        myIntelligence.Give(1);
        myDexterity.Take(1);
        FavourCheck();
    }
Beispiel #2
0
    // Start is called before the first frame update
    void Start()
    {
        strengthImage.fillAmount = 0;
        Strength     myStrength = new Strength();
        Dexterity    myDext     = new Dexterity();
        Intelligence myIntel    = new Intelligence();

        StrengthButton.onClick.AddListener(() =>
        {
            Debug.Log("Strength added");
            int StrAdd = myStrength.Give(StatIncrease);
            Debug.Log($"Strengh is {StrAdd}");
            strengthImage.fillAmount = Map((float)StrAdd, 0, 10, 0, 1);

            int DexTake = myDext.Take(StatDecrease);
            Debug.Log($"Dexterity is {DexTake}");
            DextImage.fillAmount = Map((float)DexTake, 0, 10, 0, 1);
        });
        DextButton.onClick.AddListener(() =>
        {
            int DexAdd = myDext.Give(StatIncrease);
            Debug.Log($"Dexterity is {DexAdd}");
            DextImage.fillAmount = Map((float)DexAdd, 0, 10, 0, 1);

            int StrTake = myStrength.Take(StatDecrease);
            Debug.Log($"Strengh is {StrTake}");
            strengthImage.fillAmount = Map((float)StrTake, 0, 10, 0, 1);
        });
        // WealthButton.onClick.AddListener(() =>
        // {
        //     int IntAdd = myIntel.Give(StatIncrease);
        //     Debug.Log($"Wealth is {Map(IntAdd, 0, 10, 0, 1)}");
        //     IntelImage.fillAmount = Map((float)IntAdd, 0, 10, 0, 1);
        // });
    }