Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard/UIParticleEffectManager.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

70 lines
1.9 KiB
C#

using System.Collections.Generic;
using UnityEngine;
namespace Wizard;
public class UIParticleEffectManager : MonoBehaviour
{
[SerializeField]
private GameObject _groupPrefab;
private static readonly Vector3 START_POSITION = new Vector3(4000f, 0f, 0f);
private static readonly Vector3 OFFSET_POSITION = new Vector3(4000f, 0f, 0f);
private int _groupCount;
private List<UIParticleEffectGroup> _groupList = new List<UIParticleEffectGroup>();
public static UIParticleEffectManager Instance { get; private set; }
private void Awake()
{
Instance = this;
}
public UIParticleEffectGroup StartEffect(Effect2dCreateParam param, UITexture uiTexture, bool isEnableUpdateReposition)
{
UIParticleEffectGroup uIParticleEffectGroup = CreateNewGroup(uiTexture);
uIParticleEffectGroup.StartEffect(param, isEnableUpdateReposition);
return uIParticleEffectGroup;
}
public UIParticleEffectGroup AddEffect(GameObject effect, UITexture uiTexture)
{
UIParticleEffectGroup uIParticleEffectGroup = CreateNewGroup(uiTexture);
uIParticleEffectGroup.SetEffect(effect);
return uIParticleEffectGroup;
}
public void Remove(UIParticleEffectGroup group)
{
if (_groupList.Remove(group))
{
group.OnBeforeDestroy();
Object.Destroy(group.gameObject);
}
}
public UIParticleEffectGroup CreateNewGroup(UITexture uiTexture)
{
GameObject obj = NGUITools.AddChild(base.gameObject, _groupPrefab);
UIParticleEffectGroup component = obj.GetComponent<UIParticleEffectGroup>();
component.Initialize(uiTexture);
obj.transform.localPosition = START_POSITION + OFFSET_POSITION * _groupCount;
_groupCount++;
_groupList.Add(component);
return component;
}
public void OnChangeScene()
{
foreach (UIParticleEffectGroup group in _groupList)
{
Object.Destroy(group.gameObject);
}
_groupList.Clear();
_groupCount = 0;
}
}