27 lines
518 B
C#
27 lines
518 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Chip : MonoBehaviour
|
|
{
|
|
public float value;
|
|
|
|
void Awake(){
|
|
RouletteManager.OnMoneyAvailablChanged.AddListener(OnMoneyChanged);
|
|
}
|
|
|
|
|
|
void OnMoneyChanged(float newMoney){
|
|
gameObject.SetActive(newMoney >= value);
|
|
}
|
|
|
|
|
|
void OnValidate(){
|
|
if(value == 0){
|
|
try{
|
|
value = float.Parse(gameObject.name.Replace("chip_",""));
|
|
}catch{}
|
|
}
|
|
}
|
|
}
|