1234567891011121314151617181920212223 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using WebTools.Currencies.Behaviours;
- using DataTools;
- namespace ANTM.EnviromentSystem
- {
- public class ButtonBuilding : MonoBehaviour
- {
- [Header("DATAUSER")]
- [SerializeField]
- private DataUser dataUser;
- public int levelRequired;
- public Sprite unlocked;
- public Sprite locked;
-
- void OnEnable () {
- GetComponent<BoxCollider2D>().enabled = dataUser.UserData.CurrencyData.Experience >= levelRequired;
- GetComponent<SpriteRenderer>().sprite = dataUser.UserData.CurrencyData.Experience >= levelRequired ? unlocked : locked;
- }
- }
- }
|