//-------------------------------------------------------- // [Author]: 第二世界 // [ Date ]: Monday, May 20, 2019 //-------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace vnxbqy.UI { public class ReikiRootPointPromoteWin : Window { [SerializeField] Text m_Point0; [SerializeField] Text m_Point1; [SerializeField] Text m_CloseTip; [SerializeField] Button m_Close; DateTime openTime = DateTime.Now; public static Int2 point = Int2.zero; #region Built-in protected override void BindController() { } protected override void AddListeners() { m_Close.AddListener(OnClose); } protected override void OnPreOpen() { m_Point0.text = point.x.ToString(); m_Point1.text = point.y.ToString(); m_CloseTip.SetActive(false); openTime = DateTime.Now; } protected override void OnAfterOpen() { } protected override void OnPreClose() { } protected override void OnAfterClose() { } protected override void LateUpdate() { base.LateUpdate(); if ((DateTime.Now - openTime).TotalSeconds > 2f && !m_CloseTip.gameObject.activeSelf) { m_CloseTip.SetActive(true); } } #endregion private void OnClose() { if ((DateTime.Now - openTime).TotalSeconds < 2f) { return; } CloseClick(); } } }