UI's added, shop and basic currency are done, BUGS: can move around the map when scrolling shop, object do not get selected

This commit is contained in:
Lorenzo
2022-04-05 23:57:22 +02:00
parent 525d1da14a
commit 9b47eecf6d
23 changed files with 58936 additions and 876 deletions

View File

@@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class GetPrice : MonoBehaviour
{
public TMP_Text mytext;
public TMP_Text gemsText;
private float gemsAmount;
private float updatedPrice = 0f;
private float price = 0f;
// Start is called before the first frame update
void Start()
{
updatedPrice = gemsAmount - price;
}
// Update is called once per frame
void Update()
{
}
public void getPrice()
{
if(updatedPrice >= price){
price = float.Parse(mytext.text);
gemsAmount = float.Parse(gemsText.text);
updatedPrice = gemsAmount - price;
gemsText.text = updatedPrice.ToString();
}
else Debug.Log("Not enough gems");
}
}