32 lines
895 B
C#
32 lines
895 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class SandDigLevel : MonoBehaviour
|
|
{
|
|
public GameObject[] bg;
|
|
public TMP_Text[] text_num;
|
|
private void Reset()
|
|
{
|
|
bg = new GameObject[3];
|
|
text_num = new TMP_Text[2];
|
|
bg[0] = transform.Find("bg_nml").gameObject;
|
|
bg[1] = transform.Find("bg_current").gameObject;
|
|
bg[2] = transform.Find("bg_done").gameObject;
|
|
text_num[0] = transform.Find("bg_nml/text_num").GetComponent<TMP_Text>();
|
|
text_num[1] = transform.Find("bg_current/text_num").GetComponent<TMP_Text>();
|
|
}
|
|
public void SetTextNum(string value)
|
|
{
|
|
text_num[0].text = text_num[1].text = value;
|
|
}
|
|
public void SetState(int state)
|
|
{
|
|
for (int i = 0; i < bg.Length; i++)
|
|
{
|
|
bg[i].SetActive(i == state);
|
|
}
|
|
}
|
|
}
|