89 lines
1.4 KiB
C#
89 lines
1.4 KiB
C#
using System.Xml.Serialization;
|
|
using TMPro;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
|
|
public class ShopScript : MonoBehaviour
|
|
{
|
|
[SerializeField] GameObject shopPanel;
|
|
[SerializeField] GameObject errorPanel;
|
|
InventoryScript player;
|
|
|
|
private bool paymentSystemActive = false;
|
|
[SerializeField] TMP_Text text;
|
|
TMP_Text textfeld;
|
|
//InventoryScript player;
|
|
|
|
|
|
void Start()
|
|
{
|
|
player = GetComponent<InventoryScript>();
|
|
|
|
shopPanel.SetActive(false);
|
|
errorPanel.SetActive(false);
|
|
|
|
textfeld = this.text;
|
|
//player = GetComponent<InventoryScript>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
textfeld.text = InventoryScript.deineMudda.ToString();
|
|
}
|
|
|
|
|
|
public void OpenShop()
|
|
{
|
|
shopPanel.SetActive(true);
|
|
}
|
|
|
|
public void CloseShop()
|
|
{
|
|
shopPanel.SetActive(false);
|
|
}
|
|
|
|
public void ClosePanel()
|
|
{
|
|
errorPanel.SetActive(false);
|
|
}
|
|
|
|
public void AddLife()
|
|
{
|
|
player.Health++;
|
|
}
|
|
|
|
public void AddEnergy()
|
|
{
|
|
player.Energy++;
|
|
}
|
|
|
|
public void BuyGems()
|
|
{
|
|
if (paymentSystemActive)
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
{
|
|
errorPanel.SetActive(true);
|
|
}
|
|
}
|
|
|
|
public void BuyMore()
|
|
{
|
|
|
|
int manyGemsCost = 200;
|
|
|
|
if (paymentSystemActive)
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
{
|
|
errorPanel.SetActive(true);
|
|
}
|
|
}
|
|
}
|