start of Shop system
grrr
This commit is contained in:
parent
b21d392ff6
commit
56f0f8f30f
15 changed files with 4068 additions and 3 deletions
19
Assets/Scripts/Cost.cs
Normal file
19
Assets/Scripts/Cost.cs
Normal 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();
|
||||
}
|
||||
}
|
2
Assets/Scripts/Cost.cs.meta
Normal file
2
Assets/Scripts/Cost.cs.meta
Normal file
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fbed25b47c612364aaac46b3c96be605
|
|
@ -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 }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue