增加模块退出事件监听
This commit is contained in:
parent
2e0e17543a
commit
788e8d72b5
@ -57,6 +57,7 @@ namespace QFramework.Example
|
|||||||
Dictionary<string, BodyListItem> bodyListIndex = new Dictionary<string, BodyListItem>();
|
Dictionary<string, BodyListItem> bodyListIndex = new Dictionary<string, BodyListItem>();
|
||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuithandler).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
DragBtn.onValueChanged.AddListener(isOn =>
|
DragBtn.onValueChanged.AddListener(isOn =>
|
||||||
{
|
{
|
||||||
DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn);
|
||||||
@ -146,6 +147,10 @@ namespace QFramework.Example
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModuleQuithandler(OnModuleQuit quit)
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnUIDrawClose()
|
private void OnUIDrawClose()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -18,6 +18,7 @@ namespace QFramework.Example
|
|||||||
float bgH;
|
float bgH;
|
||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuithandler).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
bgH = Content.sizeDelta.y;
|
bgH = Content.sizeDelta.y;
|
||||||
Group.onValueChanged.AddListener(isOn =>
|
Group.onValueChanged.AddListener(isOn =>
|
||||||
{
|
{
|
||||||
@ -122,6 +123,11 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModuleQuithandler(OnModuleQuit quit)
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
public void RefreshTipPath()
|
public void RefreshTipPath()
|
||||||
{
|
{
|
||||||
ListContent.RemoveAllChildren();
|
ListContent.RemoveAllChildren();
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using XMLTool;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace QFramework.Example
|
namespace QFramework.Example
|
||||||
{
|
{
|
||||||
@ -204,6 +205,7 @@ namespace QFramework.Example
|
|||||||
DOTweenAnimation contentAnim;
|
DOTweenAnimation contentAnim;
|
||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuithandler).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
contentAnim = RootContent.GetComponent<DOTweenAnimation>();
|
contentAnim = RootContent.GetComponent<DOTweenAnimation>();
|
||||||
// please add init code here
|
// please add init code here
|
||||||
Close.onClick.AddListener(() =>
|
Close.onClick.AddListener(() =>
|
||||||
@ -233,7 +235,10 @@ namespace QFramework.Example
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModuleQuithandler(OnModuleQuit quit)
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,6 +15,7 @@ namespace QFramework.Example
|
|||||||
private bool isObjectHit; // 标记是否有物体被击中
|
private bool isObjectHit; // 标记是否有物体被击中
|
||||||
protected override void OnInit(IUIData uiData = null)
|
protected override void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuithandler).UnRegisterWhenGameObjectDestroyed(this);
|
||||||
mData = uiData as UIBody3DMouseData ?? new UIBody3DMouseData();
|
mData = uiData as UIBody3DMouseData ?? new UIBody3DMouseData();
|
||||||
dragItem = Content.GetComponent<UIDragItem>();
|
dragItem = Content.GetComponent<UIDragItem>();
|
||||||
|
|
||||||
@ -31,6 +32,11 @@ namespace QFramework.Example
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnModuleQuithandler(OnModuleQuit quit)
|
||||||
|
{
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
|
||||||
private void OnEndDrag()
|
private void OnEndDrag()
|
||||||
{
|
{
|
||||||
Show3DCamera.instance.lockMove = false;
|
Show3DCamera.instance.lockMove = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user