使用UIMgr打开一个窗口时,抛出事件,从而让GuideMgr知道自己是否需要开始进行引导。

UIMgr中添加API

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
private Action<string> _showAction;
private Action<string> _hideAction;
public void AddShowListener(Action<string> listener)
{
_showAction += listener;
}
public void RemoveShowListener(Action<string> listener)
{
if (_showAction != null)
_showAction -= listener;
}
public void AddHideListener(Action<string> listener)
{
_hideAction += listener;
}
public void RemoveHideListener(Action<string> listener)
{
if (_hideAction != null)
_hideAction -= listener;
}

public IView Show(string path)
{
//...
if (view != null)
{
//...

_showAction?.Invoke(path);//+++
}
return view;
}

public void Hide(string name)
{
HideAll(_viewsDic[name]);
_hideAction?.Invoke(name);//+++
}
public Transform GetCurViewTrans()
{
string curView = _uiStack.Peek();
return GetViewTrans(curView);
}

修改ShowBack方法对于HideAll的调用,把它们改成Hide,这里略。