【ID1000291】修复编队界面进入角色界面闪现主界面问题

main
chenyuqi 2024-10-21 19:55:05 +08:00
parent 3811798b46
commit a36b803e19
5 changed files with 127 additions and 6 deletions

View File

@ -111,7 +111,7 @@ public partial class UIManager : Singlenton<UIManager>, IInitable, IUpdatable
}
}
var root = UIRoot.Instance.Root;
for (int i = root.transform.childCount - 1; i >=0; i--)
{
@ -128,7 +128,7 @@ public partial class UIManager : Singlenton<UIManager>, IInitable, IUpdatable
}
}
window.CreateWindow(data, GetIsNotSetCameraByPath(path));
if (window.uiWindowLayer == UIWindowLayer.Normal)
{
PushWindow(window);
@ -139,6 +139,67 @@ public partial class UIManager : Singlenton<UIManager>, IInitable, IUpdatable
return window;
}
//先关闭后打开
// public async UniTask<UIWindow> CreateAndOpenWindow(string path, object data = null)
// {
// if (mMemoryWindows.ContainsKey(path))
// {
// DebugUtil.LogError($"窗口已打开!!!{path}");
// //return null;
// }
//
// var window = await _LoadWindow(path, true);
// if (window != null)
// {
// var root = UIRoot.Instance.Root;
// for (int i = root.transform.childCount - 1; i >=0; i--)
// {
// var winGo = root.transform.GetChild(i).gameObject;
// if (_uiWindowObjDic.TryGetValue(winGo, out var win))
// {
// if (win != null)
// {
// if (win.uiWindowLayer > window.uiWindowLayer)
// {
// window.transform.SetSiblingIndex(i);
// }
// }
// }
// }
// window.CreateWindow(data, GetIsNotSetCameraByPath(path));
//
// if (window.uiWindowLayer == UIWindowLayer.Normal)
// {
// if (CheckWindowIsFullScreen(window))
// {
// int idx = _uiWindowStack.Count - 1;
// while (idx >= 0)
// {
// var latestWindow = _uiWindowStack[idx--];
// var bNotSet = latestWindow.IsNotSetMainCamera;
// latestWindow.IsNotSetMainCamera = true;
// latestWindow.CloseWindow(UIWindowCloseType.HideAndPush);
// latestWindow.IsNotSetMainCamera = bNotSet;
// if (CheckWindowIsFullScreen(latestWindow))
// {
// break;
// }
// }
// }
//
// }
//
// if (window.uiWindowLayer == UIWindowLayer.Normal)
// {
// PushWindow(window);
// }
//
// }
//
// return window;
// }
public bool Back()
{
return false;

View File

@ -34,7 +34,11 @@ public abstract class UIWindow
private bool _isNeedScreenAdaption;
private bool _bDoNotSetMainCamera = false; //不设置主相机
public bool IsNotSetMainCamera => _bDoNotSetMainCamera;
public bool IsNotSetMainCamera
{
get { return _bDoNotSetMainCamera; }
set { _bDoNotSetMainCamera = value; }
}
// 是否播放默认的打开对话框的声音
public bool isPlayDefaultOpenAudio = true;
@ -43,7 +47,7 @@ public abstract class UIWindow
private bool _isPlayingOpenAnim;
private Sequence _openAnimSeq;
protected Sequence _openAnimSeq;
public bool IsShowOpenAnim;
public string WindowName
@ -278,6 +282,7 @@ public abstract class UIWindow
//AudioManager3.Instance.PlaySound("");
}
}
/// <summary>
/// 关闭窗口

View File

@ -696,6 +696,8 @@ public class UIPassGameController : UIWindow
var txtLv = CommonUtils.GetComponent<TMP_Text>(item, "TextHeroLV");
var addExp = _CalculateCharExpAdd(uid);
if (addExp > 0)
{
txtExpAdd.text = "+" + addExp;
}

View File

@ -14,6 +14,55 @@ using Image = UnityEngine.UI.Image;
public class UISelectCharacterController : UIWindow
{
public static async UniTask<UIWindow> OpenLoadedUI(Team team, int index)
{
InputData inputData = new()
{
OpenType = E_OpenType.EditTeam,
Data = team,
Idx = index,
job = -1
};
UIManager.WindowInfo wInfo;
wInfo = UIManager.Instance.WindowInfos[UINameConst.UISelectCharacter];
var window = UIManager.Instance.GetOpenedWindowByPath(UINameConst.UISelectCharacter);
// if (mMemoryWindows.ContainsKey(UINameConst.UISelectCharacter))
// {
// mMemoryWindows[UINameConst.UISelectCharacter].CreateWindow(data, wInfo.NotSetMainCamera);
// }
if (window != null)
{
window.CreateWindow(inputData, wInfo.NotSetMainCamera);
}
return window;
}
public static async UniTask<UIWindow> OpenLoadedUI(Team team, int index, Ejob ejob)
{
InputData inputData = new()
{
OpenType = E_OpenType.EditTeam,
Data = team,
Idx = index,
job = (int)ejob
};
UIManager.WindowInfo wInfo;
wInfo = UIManager.Instance.WindowInfos[UINameConst.UISelectCharacter];
var window = UIManager.Instance.GetOpenedWindowByPath(UINameConst.UISelectCharacter);
// if (mMemoryWindows.ContainsKey(UINameConst.UISelectCharacter))
// {
// mMemoryWindows[UINameConst.UISelectCharacter].CreateWindow(data, wInfo.NotSetMainCamera);
// }
if (window != null)
{
window.CreateWindow(inputData, wInfo.NotSetMainCamera);
}
return window;
}
/// <summary>
/// 打开角色界面(队伍编辑)
/// </summary>

View File

@ -615,7 +615,9 @@ public class UI_TeamInfoController : UIWindow
{
AudioManager.Instance.PlayAudio(Constants.Sound.TEAM_INFO_CLICK);
idx -= _team.GetVehicleIDs().Count * 2;
await UISelectCharacterController.Open(_team, idx);
await UIManager.Instance.LoadWindow(UINameConst.UISelectCharacter);
UIManager.Instance.PushWindow(await UISelectCharacterController.OpenLoadedUI(_team, idx));
//await UISelectCharacterController.Open(_team, idx);
}
catch (Exception e)
{
@ -637,7 +639,9 @@ public class UI_TeamInfoController : UIWindow
idx -= _team.GetVehicleIDs().Count * 2;
}
await UISelectCharacterController.Open(_team, idx, jobID);
await UIManager.Instance.LoadWindow(UINameConst.UISelectCharacter);
UIManager.Instance.PushWindow(await UISelectCharacterController.OpenLoadedUI(_team, idx, jobID));
//await UISelectCharacterController.Open(_team, idx, jobID);
}
catch (Exception e)
{