MainMenue weiterbearbeitet und Shop angelegt
This commit is contained in:
74
Assets/Scripts/Button Functions/ShopScript.cs
Normal file
74
Assets/Scripts/Button Functions/ShopScript.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Xml.Serialization;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class ShopScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject shopPanel;
|
||||
[SerializeField] GameObject errorPanel;
|
||||
public InventoryScript player;
|
||||
|
||||
private bool paymentSystemActive = true;
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
player = GetComponent<InventoryScript>();
|
||||
|
||||
shopPanel.SetActive(false);
|
||||
errorPanel.SetActive(false);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OpenShop()
|
||||
{
|
||||
shopPanel.SetActive(true);
|
||||
}
|
||||
|
||||
public void CloseShop()
|
||||
{
|
||||
shopPanel.SetActive(false);
|
||||
}
|
||||
|
||||
public void AddLife()
|
||||
{
|
||||
player.Health++;
|
||||
}
|
||||
|
||||
public void AddEnergy()
|
||||
{
|
||||
player.Energy++;
|
||||
}
|
||||
|
||||
public void BuyGems()
|
||||
{
|
||||
if (paymentSystemActive)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
errorPanel.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
public void BuyMore()
|
||||
{
|
||||
if (paymentSystemActive)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
errorPanel.SetActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Button Functions/ShopScript.cs.meta
Normal file
2
Assets/Scripts/Button Functions/ShopScript.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a63d792debb71643a4072a0cc116dbe
|
||||
Reference in New Issue
Block a user