首次提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using ScrewsMaster;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ItemNumShow : MonoBehaviour
|
||||
{
|
||||
public ItemEnum iEnum;
|
||||
public Image plusIcon;
|
||||
public Text numText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.RefreshItemCount, RefreshItemCount);
|
||||
}
|
||||
private void RefreshItemCount(object obj)
|
||||
{
|
||||
var count = GameHelper.GetItemNumber(iEnum);
|
||||
plusIcon.gameObject.SetActive(count <= 0);
|
||||
numText.gameObject.SetActive(count > 0);
|
||||
numText.text = count.ToString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user