Added the basic purchase multiplier for houses and to un/assign workers.

This commit is contained in:
4-Bit-Player
2024-08-20 12:58:10 +02:00
parent 776250d08e
commit 11b7431f31
5 changed files with 422 additions and 20 deletions

View File

@@ -0,0 +1,71 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Mime;
using UnityEngine;
using UnityEngine.UIElements;
using TMPro;
using Unity.VisualScripting;
public class TogglePurchaseAmount : MonoBehaviour
{
private int[] options= {1, 10, 100};
private int selected = 0;
public int purchaseAmount = 1;
TMP_Text displayThing;
// Start is called before the first frame update
void Start()
{
displayThing = GameObject.Find("PurchaseAmountText").GetComponent<TMP_Text>();
UpdateDisplayAmount();
}
// Update is called once per frame
void Update()
{
}
public void OnClick()
{
selected = (selected + 1) % options.Length;
purchaseAmount = options[selected];
UpdateDisplayAmount();
Debug.Log(purchaseAmount);
}
private void UpdateDisplayAmount()
{
displayThing.text = "Toggle Purchase Amount x " + purchaseAmount.ToString();
}
public int GetPurchaseAmount()
{
return purchaseAmount;
}
}