feat(battle-engine): copy-loop closure to 3282 files (member-surface frontier)

This commit is contained in:
gamer147
2026-06-05 20:41:25 -04:00
parent 3dcd53933a
commit f9982f5249
41 changed files with 3030 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
using System;
using Cute;
using UnityEngine;
namespace Wizard;
public class GatheringKickConfirm : MonoBehaviour
{
[SerializeField]
private UIToggle _toggleEternal;
[SerializeField]
private UserPlateBase _userPlate;
private Action<bool> OnKickDecide;
private bool _toggleClickFirst = true;
public static void Create(GameObject prefab, GatheringUserInfo userInfo, Action<bool> onKickDecide)
{
GatheringKickConfirm component = UnityEngine.Object.Instantiate(prefab).GetComponent<GatheringKickConfirm>();
DialogBase dialog = UIManager.GetInstance().CreateDialogClose();
component.Initialize(dialog, userInfo, onKickDecide);
}
private void Initialize(DialogBase dialog, GatheringUserInfo userInfo, Action<bool> onKickDecide)
{
OnKickDecide = onKickDecide;
SystemText systemText = Data.SystemText;
string titleLabel = systemText.Get("Gathering_Member_0012");
string text_btn = systemText.Get("Gathering_Member_0005");
dialog.SetTitleLabel(titleLabel);
dialog.SetButtonText(text_btn);
dialog.SetObj(base.gameObject);
dialog.SetSize(DialogBase.Size.S);
dialog.SetButtonLayout(DialogBase.ButtonLayout.RedBtn_CancelBtn);
_userPlate.InitializeSimplePlate(userInfo);
dialog.onPushButton1 = delegate
{
OnKickDecide.Call(_toggleEternal.value);
};
_toggleEternal.onChange.Add(new EventDelegate(delegate
{
OnClickToggle();
}));
}
private void OnClickToggle()
{
if (!_toggleClickFirst)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(_toggleEternal.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
}
_toggleClickFirst = false;
}
}