engine cleanup passes 4-7 + multi-instancing ambient rip
Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed, +11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that turns concurrent battles into a type-system property rather than a scope contract. ## What landed **Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a cascading cull across the skill graph, view layer, and receive-path periphery. Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/ IsAINetwork) became `const false`, every guarded block deleted. Field*.cs subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan family reworked to take a mgr param through IMulliganMgr.InitMulligan. Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/ skill filters converted from static ambient reads to per-mgr reads via SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr. **Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient- Context / TestBattleScope in full. Every per-battle mutable slot now lives on the mgr instance itself: mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo / InstanceViewerId / InstanceNetworkAgent / GameMgr BattleManagerBase.GetIns() returns null unconditionally; the residual static flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo, ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the handful of engine-internal readers that still reference their types. Zero BattleAmbient references anywhere in engine + node + tests. Added pre-seeded GameMgr ctor overload threaded through the mgr chain (BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard- BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it to the mgr's ctor — no ambient reach. Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal BEFORE mgr construction. Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to `HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten around per-mgr construction (GetIns() → null is the pinned invariant). ## Regression fixes - **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied by the WireMulliganPhase seam; unit tests exposed the live-path gap. ## Ship state - SVSim.BattleEngine.Tests: 56/56 pass, 2 skip - SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48) - Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs in SVSim.EmulatedEntrypoint, unrelated) - Sequential PVP smoke: verified live (two back-to-back battles, no regression on cleanup/spinup) - Concurrent PVP smoke: verified live Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure analyzer needed to make future cascade cleanup safe (per feedback memory "Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -13,19 +13,14 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
OPEN,
|
||||
WAIT,
|
||||
CLOSE,
|
||||
END,
|
||||
ERASE
|
||||
}
|
||||
CLOSE }
|
||||
|
||||
public enum Size
|
||||
{
|
||||
S,
|
||||
M,
|
||||
L,
|
||||
XL,
|
||||
BATTLE_LOG
|
||||
}
|
||||
XL }
|
||||
|
||||
public enum ButtonLayout
|
||||
{
|
||||
@@ -95,19 +90,10 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
_panel.alpha = alpha;
|
||||
}
|
||||
|
||||
public void ResetAlpha()
|
||||
{
|
||||
_panel.alpha = _originalAlpha;
|
||||
}
|
||||
}
|
||||
|
||||
public enum KeyboardDialogSelect
|
||||
{
|
||||
Button1,
|
||||
Button2,
|
||||
Button3,
|
||||
CloseButton
|
||||
}
|
||||
|
||||
private class Button
|
||||
@@ -118,7 +104,7 @@ public class DialogBase : MonoBehaviour
|
||||
|
||||
public string Text { get; private set; }
|
||||
|
||||
public Se.TYPE SE { get; private set; }
|
||||
public int SE { get; private set; }
|
||||
|
||||
public Action OnClick { get; private set; }
|
||||
|
||||
@@ -132,58 +118,58 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
case ButtonType.Blue:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Red:
|
||||
Sprite = ButtonSprite.RED;
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Gray:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Yellow:
|
||||
Sprite = ButtonSprite.YELLOW;
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.OK:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
Text = systemText.Get("Common_0004");
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Decision:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
Text = systemText.Get("Common_0003");
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Close:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
Text = systemText.Get("Common_0008");
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Cancel:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
Text = systemText.Get("Common_0005");
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL;
|
||||
SE = 0;
|
||||
break;
|
||||
case ButtonType.Retry:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
Text = systemText.Get("Common_0133");
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Retry());
|
||||
};
|
||||
NetworkUI.GetInstance().SetKeepLastRequest(flag: true);
|
||||
|
||||
OnDestroy = delegate
|
||||
{
|
||||
NetworkUI.GetInstance().SetKeepLastRequest(flag: false);
|
||||
|
||||
};
|
||||
break;
|
||||
case ButtonType.BackToTitle:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
Text = systemText.Get("Common_0131");
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
SoftwareReset.exec();
|
||||
@@ -192,24 +178,20 @@ public class DialogBase : MonoBehaviour
|
||||
case ButtonType.BackToHome:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
Text = systemText.Get("Common_0132");
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL_TRANS;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
// Pre-Phase-5b: back-to-home dialog kicked off BattleEndCoroutine when in a
|
||||
// battle scene. Headless has no scene, no BattleCtrl (Chunk 7 stubbed it), and
|
||||
// no BattleEndCoroutine to run — collapse to the else branch.
|
||||
UIManager.GetInstance().closeInSceneCenterLoading();
|
||||
if (UIManager.GetInstance().GetCurrentScene() == UIManager.ViewScene.Battle && GameMgr.GetIns().GetBattleCtrl() != null)
|
||||
{
|
||||
UIManager.GetInstance().StartCoroutine(BattleEndCoroutine());
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage);
|
||||
}
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage);
|
||||
};
|
||||
break;
|
||||
case ButtonType.QuitApplication:
|
||||
Sprite = ButtonSprite.GRAY;
|
||||
Text = systemText.Get("Common_0135");
|
||||
SE = Se.TYPE.SYS_BTN_CANCEL;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
if (Toolbox.mute != null)
|
||||
@@ -223,17 +205,17 @@ public class DialogBase : MonoBehaviour
|
||||
case ButtonType.VersionUp:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
Text = systemText.Get("Common_0136");
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
Toolbox.NetworkManager.GoToStore();
|
||||
};
|
||||
NetworkUI.GetInstance().SetKeepLastRequest(flag: true);
|
||||
|
||||
break;
|
||||
case ButtonType.RecommendedList:
|
||||
Sprite = ButtonSprite.BLUE;
|
||||
Text = systemText.Get("Common_0134");
|
||||
SE = Se.TYPE.SYS_BTN_DECIDE;
|
||||
SE = 0;
|
||||
OnClick = delegate
|
||||
{
|
||||
UIManager.GetInstance().WebViewHelper.CreateOpenURLWindow(WebViewHelper.UrlType.RECOMMENDED_DEVICE);
|
||||
@@ -246,124 +228,15 @@ public class DialogBase : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
// Pre-Phase-5b: waited for SBattleLoad + BattleCtrl.BattleEnd. Both are stubbed in
|
||||
// headless (see BattleControl chunk 7); no caller after the back-to-home collapse above.
|
||||
// Kept as a stub yielding immediately so the enclosing class shape stays intact.
|
||||
private IEnumerator BattleEndCoroutine()
|
||||
{
|
||||
yield return null;
|
||||
SBattleLoad battleLoad = BattleManagerBase.GetIns().SBattleLoad;
|
||||
while (!battleLoad.isLoadEnd)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
yield return GameMgr.GetIns().GetBattleCtrl().BattleEnd();
|
||||
UIManager.ChangeViewSceneParam changeViewSceneParam = new UIManager.ChangeViewSceneParam();
|
||||
changeViewSceneParam.OnChange = delegate
|
||||
{
|
||||
UIManager.GetInstance().CloseInSceneLoadingBattle();
|
||||
};
|
||||
UIManager.GetInstance().ChangeViewScene(UIManager.ViewScene.MyPage, changeViewSceneParam);
|
||||
}
|
||||
}
|
||||
|
||||
private const int ONE_BUTTON_1BUTTON_LEFT_ANCHOR = -128;
|
||||
|
||||
private const int ONE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128;
|
||||
|
||||
private const int TWO_BUTTON_1BUTTON_LEFT_ANCHOR = 8;
|
||||
|
||||
private const int TWO_BUTTON_1BUTTON_RIGHT_ANCHOR = 264;
|
||||
|
||||
private const int TWO_BUTTON_2BUTTON_LEFT_ANCHOR = -264;
|
||||
|
||||
private const int TWO_BUTTON_2BUTTON_RIGHT_ANCHOR = -8;
|
||||
|
||||
private const int THREE_BUTTON_1BUTTON_LEFT_ANCHOR = -128;
|
||||
|
||||
private const int THREE_BUTTON_1BUTTON_RIGHT_ANCHOR = 128;
|
||||
|
||||
private const int THREE_BUTTON_2BUTTON_LEFT_ANCHOR = -398;
|
||||
|
||||
private const int THREE_BUTTON_2BUTTON_RIGHT_ANCHOR = -142;
|
||||
|
||||
private const int THREE_BUTTON_3BUTTON_LEFT_ANCHOR = 142;
|
||||
|
||||
private const int THREE_BUTTON_3BUTTON_RIGHT_ANCHOR = 398;
|
||||
|
||||
private const int WEBVIEW_ANCHOR_LEFT = 6;
|
||||
|
||||
private const int WEBVIEW_ANCHOR_BOTTOM = 18;
|
||||
|
||||
private const int WEBVIEW_ANCHOR_RIGHT = -6;
|
||||
|
||||
private const int WEBVIEW_ANCHOR_TOP = -17;
|
||||
|
||||
private const float START_ALPHA = 0.01f;
|
||||
|
||||
public const float BACKVIEW_ALPHA = 0.8f;
|
||||
|
||||
private const float OPEN_TIME = 0.3f;
|
||||
|
||||
public const int DELTA_PANEL_DEPTH = 5;
|
||||
|
||||
public static readonly Vector3 BATTLELOG_TITLELABEL_POS = new Vector3(0f, 16f, 0f);
|
||||
|
||||
public static readonly Vector3 BATTLELOG_WINDOWSPRITE_POS = new Vector3(-250f, 0f, 0f);
|
||||
|
||||
private const int BATTLELOG_WINDOW_W = 600;
|
||||
|
||||
private const int BATTLELOG_WINDOW_H = 600;
|
||||
|
||||
private const int FAQ_DEAPTH = 6100;
|
||||
|
||||
public const int FRIEND_DIALOG_DEPTH = 1000;
|
||||
|
||||
public const int ERROR_DIALOG_BATTLE = 5000;
|
||||
|
||||
public const int ERROR_DIALOG_MATCHING_DEPTH = 5400;
|
||||
|
||||
public const int ERROR_DIALOG_DEPTH = 5500;
|
||||
|
||||
public const int ERROR_ASSETHANDLE_DIALOG_DEPTH = 6000;
|
||||
|
||||
public const int HOME_LOGIN_BONUS_DEPTH = 10;
|
||||
|
||||
public const int HOME_BATTLE_RESULT_DEPTH = 15;
|
||||
|
||||
public const int QUIT_DIALOG_DEPTH = 7000;
|
||||
|
||||
public const int GATHERING_STATE_CHANGE_DIALOG_DEPTH = 4000;
|
||||
|
||||
public const int SCROLL_BOTTOM_ANCHOR_WINDOW = 8;
|
||||
|
||||
public const int SCROLL_BOTTOM_ANCHOR_BUTTON_LINE = -2;
|
||||
|
||||
private const int WEBVIEW_DISPLAY_MARGIN = 35;
|
||||
|
||||
private const int WEBVIEW_Y_OFFSET = 2;
|
||||
|
||||
private const string spriteButtonBlue = "btn_common_02_m_off";
|
||||
|
||||
private const string spriteButtonBluePush = "btn_common_02_m_on";
|
||||
|
||||
private const string spriteButtonGray = "btn_common_01_m_off";
|
||||
|
||||
private const string spriteButtonGrayPush = "btn_common_01_m_on";
|
||||
|
||||
private const string spriteButtonRed = "btn_common_04_m_off";
|
||||
|
||||
private const string spriteButtonRedPush = "btn_common_04_m_on";
|
||||
|
||||
private const string spriteButtonYellow = "btn_common_03_m_off";
|
||||
|
||||
private const string spriteButtonYellowPush = "btn_common_03_m_on";
|
||||
|
||||
private const string spriteButtonRed_S = "btn_common_04_s_off";
|
||||
|
||||
private const string spriteButtonRedPush_S = "btn_common_04_s_on";
|
||||
|
||||
private const string spriteButtonBlue_S = "btn_common_02_s_off";
|
||||
|
||||
private const string spriteButtonBluePush_S = "btn_common_02_s_on";
|
||||
|
||||
[HideInInspector]
|
||||
public NguiObjs InputAreaObjs;
|
||||
|
||||
@@ -388,13 +261,6 @@ public class DialogBase : MonoBehaviour
|
||||
[SerializeField]
|
||||
private GameObject _collider;
|
||||
|
||||
[SerializeField]
|
||||
private UIPanel _colliderPanel;
|
||||
|
||||
private float _colliderUpdateTimer;
|
||||
|
||||
private bool _colliderUpdateEnable;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel DetailMsg;
|
||||
|
||||
@@ -446,21 +312,6 @@ public class DialogBase : MonoBehaviour
|
||||
[SerializeField]
|
||||
private UIScrollView scrollView;
|
||||
|
||||
[SerializeField]
|
||||
public GameObject EscapeDialogPrefab;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _button1Select;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _button2Select;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _button3Select;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _closeButtonSelect;
|
||||
|
||||
private DialogScene dialogNowScene;
|
||||
|
||||
private ButtonLayout dialogLayout;
|
||||
@@ -502,8 +353,6 @@ public class DialogBase : MonoBehaviour
|
||||
|
||||
private string closeMsg;
|
||||
|
||||
private float timer;
|
||||
|
||||
private bool isOpenAnim = true;
|
||||
|
||||
public bool isNotCloseWindowButton1;
|
||||
@@ -524,14 +373,8 @@ public class DialogBase : MonoBehaviour
|
||||
|
||||
public InputDialog InputDialog { get; set; }
|
||||
|
||||
public bool IsEnableOpenSe { get; set; } = true;
|
||||
|
||||
public bool IsCloseByCloseButton { get; private set; }
|
||||
|
||||
public float PanelAlpha => base.gameObject.GetComponent<UIPanel>().alpha;
|
||||
|
||||
public CardDetailUI cardDetailDialog { get; set; }
|
||||
|
||||
public UIScrollView ScrollView => scrollView;
|
||||
|
||||
public GameObject Btn1GameObject
|
||||
@@ -546,57 +389,20 @@ public class DialogBase : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject Btn2GameObject => button2.gameObject;
|
||||
public int OpenSe { get; set; }
|
||||
|
||||
public Se.TYPE OpenSe { get; set; }
|
||||
public int CloseSe { get; set; }
|
||||
|
||||
public Se.TYPE CloseSe { get; set; }
|
||||
public int ClickSe_Btn1 { get; set; }
|
||||
|
||||
public Se.TYPE ClickSe_Btn1 { get; set; }
|
||||
public int ClickSe_Btn2 { get; set; }
|
||||
|
||||
public Se.TYPE ClickSe_Btn2 { get; set; }
|
||||
|
||||
public Se.TYPE ClickSe_Btn3 { get; set; }
|
||||
public int ClickSe_Btn3 { get; set; }
|
||||
|
||||
public GameObject InsideObject { get; private set; }
|
||||
|
||||
public bool IsPossibleToCloseByAndroidBackKey { get; set; }
|
||||
|
||||
public bool IsButton1Enabled
|
||||
{
|
||||
set
|
||||
{
|
||||
button1.enabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsButton2Enabled
|
||||
{
|
||||
set
|
||||
{
|
||||
button2.enabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsCloseButtonEnabled
|
||||
{
|
||||
set
|
||||
{
|
||||
CloseButton.enabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEmptyColliderEnabled
|
||||
{
|
||||
set
|
||||
{
|
||||
if (backView != null && CloseButton.gameObject.activeSelf)
|
||||
{
|
||||
backView.GetComponentInChildren<UISprite>().gameObject.AddMissingComponent<UIButton>().enabled = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool Button2Grey
|
||||
{
|
||||
set
|
||||
@@ -607,16 +413,11 @@ public class DialogBase : MonoBehaviour
|
||||
|
||||
public DialogBase()
|
||||
{
|
||||
OpenSe = Se.TYPE.SYS_DIALOG_OPEN;
|
||||
CloseSe = Se.TYPE.SYS_BTN_CANCEL;
|
||||
OpenSe = 0;
|
||||
CloseSe = 0;
|
||||
IsPossibleToCloseByAndroidBackKey = true;
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
UnityEngine.Object.Destroy(backView);
|
||||
}
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
SetButtonSprite();
|
||||
@@ -629,7 +430,7 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
if (dialogNowScene == DialogScene.WAIT)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn1);
|
||||
|
||||
if (returnObj != null && returnMsg_Btn1 != "")
|
||||
{
|
||||
returnObj.SendMessage(returnMsg_Btn1);
|
||||
@@ -649,7 +450,7 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
if (dialogNowScene == DialogScene.WAIT)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn2);
|
||||
|
||||
if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn2))
|
||||
{
|
||||
returnObj.SendMessage(returnMsg_Btn2);
|
||||
@@ -669,7 +470,7 @@ public class DialogBase : MonoBehaviour
|
||||
{
|
||||
if (dialogNowScene == DialogScene.WAIT)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(ClickSe_Btn3);
|
||||
|
||||
if (returnObj != null && !string.IsNullOrEmpty(returnMsg_Btn3))
|
||||
{
|
||||
returnObj.SendMessage(returnMsg_Btn3);
|
||||
@@ -724,7 +525,7 @@ public class DialogBase : MonoBehaviour
|
||||
private void CloseNotSelect(bool isCloseButton)
|
||||
{
|
||||
IsCloseByCloseButton = isCloseButton;
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(CloseSe);
|
||||
|
||||
Close();
|
||||
if (returnObj != null && !string.IsNullOrEmpty(closeMsg))
|
||||
{
|
||||
@@ -736,92 +537,6 @@ public class DialogBase : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void ColliderUpdate()
|
||||
{
|
||||
if (_colliderUpdateEnable)
|
||||
{
|
||||
_colliderUpdateTimer += Time.deltaTime;
|
||||
if (_colliderUpdateTimer >= 0.24000001f)
|
||||
{
|
||||
_collider.SetActive(value: false);
|
||||
_colliderUpdateEnable = false;
|
||||
_colliderUpdateTimer = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (ToolboxGame.GameManager == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ColliderUpdate();
|
||||
switch (dialogNowScene)
|
||||
{
|
||||
case DialogScene.OPEN:
|
||||
{
|
||||
if (IsEnableOpenSe)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(OpenSe);
|
||||
}
|
||||
dialogNowScene = DialogScene.WAIT;
|
||||
if (onFirstUpdate != null)
|
||||
{
|
||||
onFirstUpdate();
|
||||
}
|
||||
if (isOpenAnim)
|
||||
{
|
||||
iTween.MoveFrom(base.gameObject, iTween.Hash("y", base.transform.localPosition.y - 5f, "time", 0.3f, "movetopath", false, "islocal", true, "easetype", iTween.EaseType.easeOutCubic));
|
||||
TweenAlpha.Begin(base.gameObject, 0.3f, 1f);
|
||||
if (backView != null)
|
||||
{
|
||||
TweenAlpha.Begin(backView.gameObject, 0.3f, 1f);
|
||||
}
|
||||
}
|
||||
_colliderUpdateEnable = true;
|
||||
_colliderUpdateTimer = 0f;
|
||||
for (int i = 0; i < _insideObjectUIPanelAlphaControllerList.Count; i++)
|
||||
{
|
||||
_insideObjectUIPanelAlphaControllerList[i].ResetAlpha();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DialogScene.CLOSE:
|
||||
timer = 0.01f;
|
||||
dialogNowScene = DialogScene.END;
|
||||
break;
|
||||
case DialogScene.END:
|
||||
timer -= Time.deltaTime;
|
||||
if (timer <= 0f)
|
||||
{
|
||||
Dispose();
|
||||
dialogNowScene = DialogScene.ERASE;
|
||||
}
|
||||
break;
|
||||
case DialogScene.WAIT:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void Dispose()
|
||||
{
|
||||
if (OnClose != null)
|
||||
{
|
||||
OnClose();
|
||||
}
|
||||
if (OnClose_ForSystem != null)
|
||||
{
|
||||
OnClose_ForSystem();
|
||||
}
|
||||
UnityEngine.Object.Destroy(base.gameObject);
|
||||
}
|
||||
|
||||
public DialogScene GetNowScene()
|
||||
{
|
||||
return dialogNowScene;
|
||||
}
|
||||
|
||||
public bool IsOpen()
|
||||
{
|
||||
if (dialogNowScene != DialogScene.OPEN)
|
||||
@@ -847,32 +562,16 @@ public class DialogBase : MonoBehaviour
|
||||
scrollView.GetComponent<UIPanel>().ResetAndUpdateAnchors();
|
||||
}
|
||||
|
||||
public void SetAnchors()
|
||||
{
|
||||
WindowSprite.SetAnchor(base.gameObject, 6, 18, -6, -17);
|
||||
}
|
||||
|
||||
public void SetTitleLabel(string str)
|
||||
{
|
||||
titleLabel.text = str;
|
||||
}
|
||||
|
||||
public string GetTitleLabelStr()
|
||||
{
|
||||
return titleLabel.text;
|
||||
}
|
||||
|
||||
public void SetTitleLabelActive(bool active)
|
||||
{
|
||||
titleLabel.gameObject.SetActive(active);
|
||||
}
|
||||
|
||||
public void AttachObjToTitleLabel(GameObject obj, Action<UILabel> initializeCallBack)
|
||||
{
|
||||
obj.transform.parent = TitleObjs.transform;
|
||||
initializeCallBack.Call(titleLabel);
|
||||
}
|
||||
|
||||
public void AttachObjToTitleLabel(GameObject obj, Vector3 localPosition)
|
||||
{
|
||||
obj.transform.parent = TitleObjs.transform;
|
||||
@@ -1141,7 +840,7 @@ public class DialogBase : MonoBehaviour
|
||||
};
|
||||
}
|
||||
|
||||
private void Display_1_Button(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1)
|
||||
private void Display_1_Button(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1)
|
||||
{
|
||||
ButtonBase.SetActive(value: true);
|
||||
button1.gameObject.SetActive(value: true);
|
||||
@@ -1162,7 +861,7 @@ public class DialogBase : MonoBehaviour
|
||||
Display_1_Button(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy);
|
||||
}
|
||||
|
||||
private void Display_2_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2)
|
||||
private void Display_2_Buttons(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, int se_btn2, Action onClick_btn2, Action onDestroy_btn2)
|
||||
{
|
||||
ButtonBase.SetActive(value: true);
|
||||
button1.gameObject.SetActive(value: true);
|
||||
@@ -1186,7 +885,7 @@ public class DialogBase : MonoBehaviour
|
||||
Display_2_Buttons(btn1.Sprite, btn1.Text, btn1.SE, btn1.OnClick, btn1.OnDestroy, btn2.Sprite, btn2.Text, btn2.SE, btn2.OnClick, btn2.OnDestroy);
|
||||
}
|
||||
|
||||
private void Display_3_Buttons(ButtonSprite sprite_btn1, string text_btn1, Se.TYPE se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, Se.TYPE se_btn2, Action onClick_btn2, Action onDestroy_btn2, ButtonSprite sprite_btn3, string text_btn3, Se.TYPE se_btn3, Action onClick_btn3, Action onDestroy_btn3)
|
||||
private void Display_3_Buttons(ButtonSprite sprite_btn1, string text_btn1, int se_btn1, Action onClick_btn1, Action onDestroy_btn1, ButtonSprite sprite_btn2, string text_btn2, int se_btn2, Action onClick_btn2, Action onDestroy_btn2, ButtonSprite sprite_btn3, string text_btn3, int se_btn3, Action onClick_btn3, Action onDestroy_btn3)
|
||||
{
|
||||
ButtonBase.SetActive(value: true);
|
||||
button1.gameObject.SetActive(value: true);
|
||||
@@ -1260,7 +959,7 @@ public class DialogBase : MonoBehaviour
|
||||
scrollBarRect.UpdateAnchors();
|
||||
}
|
||||
|
||||
private void SetButtonSe(Se.TYPE btn1 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn2 = Se.TYPE.SYS_BTN_DECIDE, Se.TYPE btn3 = Se.TYPE.SYS_BTN_DECIDE)
|
||||
private void SetButtonSe(int btn1 = 0, int btn2 = 0, int btn3 = 0)
|
||||
{
|
||||
ClickSe_Btn1 = btn1;
|
||||
ClickSe_Btn2 = btn2;
|
||||
@@ -1281,18 +980,6 @@ public class DialogBase : MonoBehaviour
|
||||
scrollView.GetComponent<UIPanel>().bottomAnchor.absolute += (int)contactButton.GetComponent<BoxCollider>().size.y;
|
||||
}
|
||||
|
||||
public void SetRefund(string url, string buttonText)
|
||||
{
|
||||
contactButton.gameObject.SetActive(value: true);
|
||||
contactButton.onClick.Clear();
|
||||
contactButton.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
UIManager.GetInstance().WebViewHelper.OpenUrl(url);
|
||||
}));
|
||||
contactButton_Label.text = buttonText;
|
||||
scrollView.GetComponent<UIPanel>().bottomAnchor.absolute += (int)contactButton.GetComponent<BoxCollider>().size.y;
|
||||
}
|
||||
|
||||
public void SetVisibleWebViewBackButton(string url, bool isVisible)
|
||||
{
|
||||
webviewBackButton.gameObject.SetActive(isVisible);
|
||||
@@ -1322,19 +1009,6 @@ public class DialogBase : MonoBehaviour
|
||||
}));
|
||||
}
|
||||
|
||||
public void AddVScrollBar(UIScrollView view)
|
||||
{
|
||||
view.verticalScrollBar = vScrollBar;
|
||||
scrollView.verticalScrollBar = null;
|
||||
}
|
||||
|
||||
public void AttachScrollView(UIScrollView view, float scrollStartValue)
|
||||
{
|
||||
scrollView.verticalScrollBar = null;
|
||||
view.verticalScrollBar = vScrollBar;
|
||||
view.verticalScrollBar.value = scrollStartValue;
|
||||
}
|
||||
|
||||
public void CloseWithoutSelect()
|
||||
{
|
||||
if (!(this == null))
|
||||
@@ -1365,28 +1039,6 @@ public class DialogBase : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void CloseSoon()
|
||||
{
|
||||
if (!(UIManager.GetInstance() != null) || !(this != null) || !(this == UIManager.GetInstance().ApplicationFinishManager.QuitDialog))
|
||||
{
|
||||
UIManager.GetInstance().CloseInSceneLoadingMatching();
|
||||
}
|
||||
OnCloseStart.Call();
|
||||
Dispose();
|
||||
}
|
||||
|
||||
public void ReOpen(bool isResetBackViewAlpha = false)
|
||||
{
|
||||
SetActive(inActive: true);
|
||||
base.gameObject.GetComponent<UIPanel>().alpha = 0.01f;
|
||||
dialogNowScene = DialogScene.OPEN;
|
||||
_collider.SetActive(value: true);
|
||||
if (isResetBackViewAlpha)
|
||||
{
|
||||
ResetBackViewAlpha();
|
||||
}
|
||||
}
|
||||
|
||||
public void TitleOnOff(bool flag)
|
||||
{
|
||||
TitleObjs.gameObject.SetActive(flag);
|
||||
@@ -1397,42 +1049,6 @@ public class DialogBase : MonoBehaviour
|
||||
CloseButton.gameObject.SetActive(flag);
|
||||
}
|
||||
|
||||
public void SetButtonLineVisible(bool b)
|
||||
{
|
||||
buttonLine.gameObject.SetActive(b);
|
||||
}
|
||||
|
||||
private void SetTextActive(bool b)
|
||||
{
|
||||
DetailMsg.gameObject.SetActive(b);
|
||||
}
|
||||
|
||||
public void SetTitleLineVisible(bool visible)
|
||||
{
|
||||
if (null != titleLine && titleLine.enabled != visible)
|
||||
{
|
||||
titleLine.enabled = visible;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetWindowSprite(string atlasname, string spritename)
|
||||
{
|
||||
List<UIAtlas> atlasList = UIManager.GetInstance().GetAtlasList();
|
||||
if (atlasList == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < atlasList.Count; i++)
|
||||
{
|
||||
if (atlasList[i].name == atlasname)
|
||||
{
|
||||
WindowSprite.atlas = atlasList[i];
|
||||
WindowSprite.spriteName = spritename;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPanelDepth(int depth, bool isSetBackViewDepthImmediately = false)
|
||||
{
|
||||
GetComponent<UIPanel>().depth = depth;
|
||||
@@ -1447,11 +1063,6 @@ public class DialogBase : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public int GetPanelDepth()
|
||||
{
|
||||
return GetComponent<UIPanel>().depth;
|
||||
}
|
||||
|
||||
private void backViewDepth()
|
||||
{
|
||||
UIPanel component = GetComponent<UIPanel>();
|
||||
@@ -1532,16 +1143,6 @@ public class DialogBase : MonoBehaviour
|
||||
t.localPosition = Vector3.zero;
|
||||
}
|
||||
|
||||
public void InactiveBackView()
|
||||
{
|
||||
backView.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void ResetBackViewAlpha()
|
||||
{
|
||||
backView.gameObject.GetComponent<UIPanel>().alpha = 1f;
|
||||
}
|
||||
|
||||
public void SetFadeButtonEnabled(bool flag)
|
||||
{
|
||||
CloseOnOff(flag);
|
||||
@@ -1611,42 +1212,6 @@ public class DialogBase : MonoBehaviour
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
public void FadeOut()
|
||||
{
|
||||
FadeUtility.FadeOutGameObject(base.gameObject);
|
||||
FadeUtility.FadeOutGameObject(backView.gameObject);
|
||||
}
|
||||
|
||||
public void KeyboardSelectButton(KeyboardDialogSelect select, bool enable)
|
||||
{
|
||||
switch (select)
|
||||
{
|
||||
case KeyboardDialogSelect.Button1:
|
||||
_button1Select.SetActive(enable);
|
||||
break;
|
||||
case KeyboardDialogSelect.Button2:
|
||||
_button2Select.SetActive(enable);
|
||||
break;
|
||||
case KeyboardDialogSelect.Button3:
|
||||
_button3Select.SetActive(enable);
|
||||
break;
|
||||
case KeyboardDialogSelect.CloseButton:
|
||||
_closeButtonSelect.SetActive(enable);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector4 GetWebViewDisplayRect()
|
||||
{
|
||||
return new Vector4
|
||||
{
|
||||
x = 0f,
|
||||
y = -30f,
|
||||
z = 1100f,
|
||||
w = 510f
|
||||
};
|
||||
}
|
||||
|
||||
public void AutoClose(float second)
|
||||
{
|
||||
if (_autoCloseCoroutine == null)
|
||||
@@ -1675,15 +1240,4 @@ public class DialogBase : MonoBehaviour
|
||||
CloseButton.enabled = false;
|
||||
IsPossibleToCloseByAndroidBackKey = false;
|
||||
}
|
||||
|
||||
public int GetMaxPanelDepth()
|
||||
{
|
||||
UIPanel[] second = new UIPanel[1] { _colliderPanel };
|
||||
return base.transform.GetComponentsInChildren<UIPanel>().Except(second).Max((UIPanel x) => x.depth);
|
||||
}
|
||||
|
||||
public void SetPanelDepthAboveDialog(DialogBase dialog)
|
||||
{
|
||||
SetPanelDepth(dialog.GetMaxPanelDepth() + 5);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user