Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/BattlePassGuage.cs
gamer147 957af3d1ec feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
2026-06-05 17:22:20 -04:00

159 lines
4.5 KiB
C#

using System.Collections;
using UnityEngine;
namespace Wizard;
public class BattlePassGuage : MonoBehaviour
{
[SerializeField]
public ParticleSystem GaugeEfc;
[SerializeField]
private UIGauge _uIGauge;
[SerializeField]
private UILabel _nextLevelTitleLabel;
[SerializeField]
private UILabel _nextLevelPoint;
[SerializeField]
private UILabel _level;
[SerializeField]
private UISprite _battlePassIcon;
private BattlePassGaugeInfo _battlePassGaugeInfo;
private const float GAUGEUP_DURATION = 0.3f;
private const float GAUGEUP_DELAY = 1f;
private const float GAUGE_SIZE = 1.15f;
private const int GAUGEUP_SE_CNT = 6;
private int _nowLevel;
private int _nowNextLevelPoint;
public bool IsAnimationComplete { get; private set; }
public void Initialize(BattlePassGaugeInfo battlePassGaugeInfo)
{
_uIGauge.Value = battlePassGaugeInfo.CurrentGaugeValue();
_nextLevelTitleLabel.text = Data.SystemText.Get("BattlePass_0009");
_nextLevelPoint.text = battlePassGaugeInfo.NextLevelRequiredPoint.ToString();
_level.text = battlePassGaugeInfo.CurrentLevel.ToString();
}
public void LvUpInitialize(BattlePassGaugeInfo battlePassGaugeInfo)
{
_battlePassGaugeInfo = battlePassGaugeInfo;
_battlePassIcon.spriteName = (battlePassGaugeInfo.IsPremium ? "icon_battlepass_premium" : "icon_battlepass_normal");
_uIGauge.Value = battlePassGaugeInfo.BeforeGaugeValue;
_nextLevelTitleLabel.text = Data.SystemText.Get("BattlePass_0009");
_nowNextLevelPoint = battlePassGaugeInfo.BeforeLevelNextLevelRequiredPoint;
_nextLevelPoint.text = _nowNextLevelPoint.ToString();
_level.text = battlePassGaugeInfo.BeforeCurrentLevel.ToString();
}
public void AddBattlePassPoint()
{
_nowLevel = _battlePassGaugeInfo.BeforeCurrentLevel;
StartCoroutine(AddBattlePassPointCor());
}
private IEnumerator AddBattlePassPointCor()
{
yield return new WaitForSeconds(0.5f);
if (_battlePassGaugeInfo.IsLevelChange)
{
SetGaugeAniamtion(_uIGauge.Value, 1f, "LvUp");
}
else
{
SetGaugeAniamtion(_uIGauge.Value, _battlePassGaugeInfo.CurrentGaugeValue(), "LvupComplete");
}
}
private void LvUp()
{
_nowLevel++;
_level.text = _nowLevel.ToString();
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_LEVELUP);
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_LVUP_1, _battlePassIcon.transform.position)
.gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true);
Effect effect = GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_RESULT_GAUGE_2, _uIGauge.GetTransformGaugeStartEdge().position);
if (effect != null)
{
effect.transform.localScale = Vector3.one * 1.15f;
effect.gameObject.SetLayer(LayerMask.NameToLayer("SystemUI"), isSetChildren: true);
}
if (_nowLevel == BattlePassUtility.BattlePassMaxLevel)
{
LvupComplete();
}
else if (_nowLevel < _battlePassGaugeInfo.CurrentLevel)
{
SetGaugeAniamtion(0f, 1f, "LvUp");
}
else
{
SetGaugeAniamtion(0f, _battlePassGaugeInfo.CurrentGaugeValue(), "LvupComplete");
}
}
private void SetGaugeAniamtion(float from, float to, string oncomp = "")
{
iTween.ValueTo(base.gameObject, iTween.Hash("from", from, "to", to, "time", 0.3f, "delay", 0.1f, "onstart", "StartBattlePassPoint", "onupdate", "UpdateBattlePassPoint", "oncomplete", oncomp, "easetype", iTween.EaseType.easeOutQuad));
}
private void StartBattlePassPoint()
{
PlayGaugeUpSE();
GaugeEfc.gameObject.SetActive(value: true);
GaugeEfc.Play();
}
private void PlayGaugeUpSE()
{
StartCoroutine(GaugeUpSECoroutine());
}
private IEnumerator GaugeUpSECoroutine()
{
for (int i = 0; i < 6; i++)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_RESULT_GAUGEUP);
yield return new WaitForSeconds(0.05f);
}
}
private void UpdateBattlePassPoint(float num)
{
_uIGauge.Value = num;
int num2 = BattlePassUtility.NextLevelRequiredPoint(_nowLevel);
_nowNextLevelPoint = num2 - (int)((float)num2 * num);
_nextLevelPoint.text = _nowNextLevelPoint.ToString();
}
private void CompleteBattlePassPoint()
{
GaugeEfc.Stop();
}
private void LvupComplete()
{
_nextLevelPoint.text = _battlePassGaugeInfo.NextLevelRequiredPoint.ToString();
StartCoroutine(SetLvupCompletAnimation());
}
private IEnumerator SetLvupCompletAnimation()
{
yield return new WaitForSeconds(0.1f);
CompleteBattlePassPoint();
IsAnimationComplete = true;
}
}