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