// Use this for initialization void Start() { if (ItemRemindLogic.Instance() != null) { ItemRemindLogic.Instance().HandleEquipRemind(false); } }
void ShowRemind() { if (m_UseItemBuffer.Count > 0) { // 处在显示状态且时间已达到10秒 if (Time.fixedTime - m_fStartShowTime >= ShowTime && m_bOnShow) { m_bOnShow = false; m_bOnHide = true; m_fStartShowTime = 0.0f; m_fStartHideTime = Time.fixedTime; m_ItemRemind.SetActive(false); if (ItemRemindLogic.Instance() != null) { ItemRemindLogic.Instance().HandleEquipRemind(false); } m_UseItemBuffer.RemoveAt(0); } // 未处在显示10秒和隐藏2秒状态 且自身需要显示 else if (!m_ItemRemind.activeInHierarchy && !m_bOnHide) { //装备提醒 在的时候暂时不显示 if (EquipRemindLogic.Instance() == null || (EquipRemindLogic.Instance() != null && EquipRemindLogic.Instance().m_EquipRemind.activeInHierarchy == false)) { m_fStartShowTime = Time.fixedTime; m_ItemRemind.SetActive(true); if (ItemRemindLogic.Instance() != null) { ItemRemindLogic.Instance().HandleEquipRemind(true); } if (m_UseItemBuffer[0] == null || !m_UseItemBuffer[0].IsValid()) { return; } Tab_CommonItem tabItem = TableManager.GetCommonItemByID(m_UseItemBuffer[0].DataID, 0); if (tabItem != null) { m_IconSprite.spriteName = tabItem.Icon; m_IconSprite.MakePixelPerfect(); m_QualitySprite.spriteName = GlobeVar.QualityColorGrid[tabItem.Quality - 1]; m_TitleNameLabel.text = tabItem.Name; m_bOnShow = true; } } } // 处在隐藏状态且时间已达到2秒 if (Time.fixedTime - m_fStartHideTime >= HideTime && m_bOnHide) { m_bOnHide = false; m_fStartHideTime = 0.0f; } } else { UIManager.CloseUI(UIInfo.UseItemRemindRoot); } }
void ClearData() { m_bOnShow = false; m_bOnHide = false; m_fStartShowTime = 0.0f; m_fStartHideTime = 0.0f; m_EquipRemind.SetActive(false); if (ItemRemindLogic.Instance() != null) { ItemRemindLogic.Instance().HandleEquipRemind(false); } }
void CloseCurItem() { m_bOnShow = false; m_bOnHide = false; m_fStartShowTime = 0.0f; m_fStartHideTime = 0.0f; if (m_UseItemBuffer.Count > 0) { m_UseItemBuffer.RemoveAt(0); } m_ItemRemind.SetActive(false); if (ItemRemindLogic.Instance() != null) { ItemRemindLogic.Instance().HandleEquipRemind(false); } }
static void ShowUIOver(bool bSuccess, object param) { if (bSuccess) { List <object> initParams = param as List <object>; int nDataID = (int)initParams[0]; if (ItemRemindLogic.Instance() != null) { if (EquipRemindLogic.Instance() != null) { ItemRemindLogic.Instance().m_Trans.localPosition = new Vector3(210, 400, 0); } ItemRemindLogic.Instance().m_ItemDataIDBuffer.Add(nDataID); } } }