退出模块隐藏UI
This commit is contained in:
parent
abc7ffedc4
commit
e8b937e0a6
@ -763,7 +763,7 @@ MonoBehaviour:
|
||||
m_ScrollSensitivity: 1
|
||||
m_Viewport: {fileID: 8731652694218410629}
|
||||
m_HorizontalScrollbar: {fileID: 0}
|
||||
m_VerticalScrollbar: {fileID: 1945366071212582513}
|
||||
m_VerticalScrollbar: {fileID: 0}
|
||||
m_HorizontalScrollbarVisibility: 2
|
||||
m_VerticalScrollbarVisibility: 2
|
||||
m_HorizontalScrollbarSpacing: -3
|
||||
@ -1068,7 +1068,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6772576175566796072
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -1248,9 +1248,9 @@ RectTransform:
|
||||
m_Father: {fileID: 2192231524565599668}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: -12, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!222 &1726614218311108045
|
||||
CanvasRenderer:
|
||||
@ -1336,7 +1336,7 @@ RectTransform:
|
||||
m_Father: {fileID: 1644315794790874757}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
|
||||
@ -19,6 +19,7 @@ namespace QFramework.Example
|
||||
mData = uiData as UIBtnsData ?? new UIBtnsData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -22,6 +22,7 @@ namespace QFramework.Example
|
||||
{
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
mData = uiData as UICameraSwitchData ?? new UICameraSwitchData();
|
||||
// please add init code here
|
||||
Near.onValueChanged.AddListener(isOn =>
|
||||
|
||||
@ -13,6 +13,7 @@ namespace QFramework.Example
|
||||
{
|
||||
mData = uiData as UIDeviceTipData ?? new UIDeviceTipData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
|
||||
@ -23,6 +23,7 @@ namespace QFramework.Example
|
||||
mData = uiData as UIHintData ?? new UIHintData();
|
||||
SetItem(0);
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -12,6 +12,7 @@ namespace QFramework.Example
|
||||
{
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
mData = uiData as UIInstructionData ?? new UIInstructionData();
|
||||
// please add init code here
|
||||
Training.onValueChanged.AddListener(isOn =>
|
||||
|
||||
@ -14,6 +14,7 @@ namespace QFramework.Example
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UILoadingData ?? new UILoadingData();
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
TypeEventSystem.Global.Register<OnLoadingShow>(arg => Show()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
TypeEventSystem.Global.Register<OnLoadingHide>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ namespace QFramework.Example
|
||||
{
|
||||
mData = uiData as UIOperationListData ?? new UIOperationListData();
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg)=>Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
@ -67,7 +68,7 @@ namespace QFramework.Example
|
||||
break;
|
||||
case StepStatus.Finished:
|
||||
// TODO:实现方式过于耦合 后期优化
|
||||
if (Global.Instance.curModule.type=="Exam")
|
||||
if (Global.Instance.curModule.type == "Exam")
|
||||
{
|
||||
stepLabel.color = highColor;
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ namespace QFramework.Example
|
||||
mData = uiData as UIPointQuestionData ?? new UIPointQuestionData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -21,6 +21,7 @@ namespace QFramework.Example
|
||||
Right.gameObject.SetActive(false);
|
||||
Wrong.gameObject.SetActive(false);
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -13,8 +13,6 @@ namespace QFramework.Example
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UIRightTopData ?? new UIRightTopData();
|
||||
|
||||
|
||||
setBtn.onClick.AddListener(() =>
|
||||
{
|
||||
UIKit.OpenPanelAsync<UISetting>(canvasLevel: UILevel.PopUI).ToAction().StartGlobal();
|
||||
|
||||
@ -12,6 +12,7 @@ namespace QFramework.Example
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UIScoreData ?? new UIScoreData();
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
DownLoad.onClick.AddListener(() =>
|
||||
{
|
||||
if (string.IsNullOrEmpty(InputName.text) || string.IsNullOrEmpty(InputId.text))
|
||||
|
||||
@ -35,6 +35,7 @@ namespace QFramework.Example
|
||||
mData = uiData as UITextQuestionData ?? new UITextQuestionData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -21,6 +21,7 @@ namespace QFramework.Example
|
||||
|
||||
mData = uiData as UITextTipData ?? new UITextTipData();
|
||||
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
|
||||
@ -42,6 +42,7 @@ namespace QFramework.Example
|
||||
{
|
||||
mData = uiData as UITimeTipData ?? new UITimeTipData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
||||
@ -28,6 +28,7 @@ namespace QFramework.Example
|
||||
// please add init code here
|
||||
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
|
||||
@ -31,6 +31,7 @@ namespace QFramework.Example
|
||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||
// please add init code here
|
||||
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
}
|
||||
|
||||
private void OnStepChanged(StepStatusOnChange change)
|
||||
@ -40,7 +41,6 @@ namespace QFramework.Example
|
||||
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
{
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnModuleQuit).UnRegisterWhenDisabled(gameObject);
|
||||
mResLoader = ResLoader.Allocate();
|
||||
mData = uiData as UIToolsData ?? new UIToolsData();
|
||||
if (string.IsNullOrEmpty(mData.answer) == false)
|
||||
|
||||
@ -24,30 +24,14 @@ namespace QFramework.Example
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UIVideoData ?? new UIVideoData();
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Close()).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
// please add init code here
|
||||
Progress.onValueChanged.AddListener(OnSliderValueChanged);
|
||||
Progress.OnBeginDragEvent(OnProgressBeginDrag);
|
||||
Progress.OnEndDragEvent(OnProgressEndDrag);
|
||||
player.loopPointReached += VideoPlayer_loopPointReached;
|
||||
player.prepareCompleted += OnPrepareCompleted;
|
||||
CloseBtn.onClick.AddListener(() =>
|
||||
{
|
||||
if (player.isPlaying)
|
||||
{
|
||||
player.Stop();
|
||||
|
||||
}
|
||||
if (string.IsNullOrEmpty(mData.finishedEvent) == false)
|
||||
{
|
||||
StringEventSystem.Global.Send(mData.finishedEvent);
|
||||
}
|
||||
if (string.IsNullOrEmpty(mData.closeEvent) == false)
|
||||
{
|
||||
StringEventSystem.Global.Send(mData.closeEvent);
|
||||
}
|
||||
player.targetTexture.Release();
|
||||
Hide();
|
||||
});
|
||||
CloseBtn.onClick.AddListener(Close);
|
||||
VideoPlayBtn.onClick.AddListener(() =>
|
||||
{
|
||||
player.Pause();
|
||||
@ -80,6 +64,26 @@ namespace QFramework.Example
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (player.isPlaying)
|
||||
{
|
||||
player.Stop();
|
||||
|
||||
}
|
||||
if (string.IsNullOrEmpty(mData.finishedEvent) == false)
|
||||
{
|
||||
StringEventSystem.Global.Send(mData.finishedEvent);
|
||||
}
|
||||
if (string.IsNullOrEmpty(mData.closeEvent) == false)
|
||||
{
|
||||
StringEventSystem.Global.Send(mData.closeEvent);
|
||||
}
|
||||
player.targetTexture.Release();
|
||||
Hide();
|
||||
|
||||
}
|
||||
|
||||
private void OnPrepareCompleted(VideoPlayer source)
|
||||
{
|
||||
Progress.maxValue = (float)player.length;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user