start of Shop system

grrr
This commit is contained in:
Kirabsol 2025-01-22 18:01:31 +01:00
parent b21d392ff6
commit 56f0f8f30f
15 changed files with 4068 additions and 3 deletions

19
Assets/Scripts/Cost.cs Normal file
View file

@ -0,0 +1,19 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Unity.VisualScripting;
using System;
public class Cost : MonoBehaviour
{
private int cost;
[SerializeField] TextMeshProUGUI texteCout;
[SerializeField] TextMeshProUGUI unit;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
cost = GlobalsVariable.prices[unit.text];
texteCout.text = cost.ToString();
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: fbed25b47c612364aaac46b3c96be605

View file

@ -9,4 +9,13 @@ public static class GlobalsVariable
public static AbstractUnit QueenA;
public static AbstractUnit QueenB;
public static Dictionary<string, int> prices = new Dictionary<string, int>()
{
{ "Zombie",1 },
{ "Squelette",2 },
{ "Creeper",3 },
{ "Sorcière",3 },
{ "Golem",8 }
};
}