Ejemplo n.º 1
0
    public static UIMaskManager GetInstance()
    {
        if (_instance == null)
        {
            _instance = new GameObject("_UIMaskManager").AddComponent <UIMaskManager>(); //为了保证这个脚本是挂载在一个对象上
        }

        return(_instance);
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 显示状态
 /// </summary>
 public virtual void Display()
 {
     this.gameObject.SetActive(true);
     //设置UI遮罩
     if (GetUIType() == UIFormType.PopUp)
     {
         UIMaskManager.GetInstance().SetMaskWindow(this, CurrentUIType.UIForm_Luceny);
     }
     if (m_btnClose != null && OnCloseAction == null)
     {
         m_btnClose.onClick.AddListener(OnCloseTodo);
     }
     if (m_btnClose != null && OnCloseAction != null)
     {
         m_btnClose.onClick.AddListener(OnCloseAction);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 隐藏状态
 /// </summary>
 public virtual void Hiding()
 {
     //取消UI遮罩
     if (GetUIType() == UIFormType.PopUp)
     {
         UIMaskManager.GetInstance().CancelMaskWindow(this);
     }
     if (m_btnClose != null && OnCloseAction == null)
     {
         m_btnClose.onClick.RemoveListener(OnCloseTodo);
     }
     if (m_btnClose != null && OnCloseAction != null)
     {
         m_btnClose.onClick.RemoveListener(OnCloseAction);
     }
     //删除自身
     GameObject.Destroy(this.gameObject);
 }