You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlumberUltimateAds/Assets/Scripts/LevelGroupState.cs

55 lines
1.1 KiB
C#

2 months ago
/*
http://www.cgsoso.com/forum-211-1.html
CG Unity3d Unity3d VIP
CGSOSO CG
daily assets update for try.
U should buy the asset from home store if u use it in your project!
*/
using UnityEngine;
using UnityEngine.UI;
[ExecuteInEditMode]
public class LevelGroupState : MonoBehaviour
{
public LevelGroup levelGroup;
[Header("Show Detail")]
[SerializeField]
private Text TitleLbl;
[SerializeField]
private Text LevelCompletdLbl;
[SerializeField]
private Text AvarageTimeLbl;
[SerializeField]
private GameObject AwardGoldImage;
private void Start()
{
UpdateUI();
}
private void Update()
{
}
[ContextMenu("UpdateUI")]
public void UpdateUI()
{
base.name = levelGroup.LevelGroupName;
TitleLbl.text = base.name.ToUpper();
LevelCompletdLbl.text = levelGroup.CompletedLevel + " / " + levelGroup.TotalLevel;
AvarageTimeLbl.text = levelGroup.AverageCompletedTimeString;
AwardGoldImage.SetActive(levelGroup.CompletedLevel >= levelGroup.TotalLevel);
}
}