The stub generator emits net-new types as base-LESS partials, so generated Vfx/View types weren't actually VfxBase/etc. -> hundreds of CS1503/CS0029 'cannot convert to VfxBase' at every polymorphic call site. m1_baseclauses.py recovers each generated type's decomp base CLASS (interfaces dropped to avoid CS0535) into _BaseClauses.g.cs, cross-namespace bases fully qualified. Generated the intermediate Vfx/processing base types (SpreadOutVfx/OpenCardVfx/ProcessingBase/DamageVfxBase/ForecastIconVfxBase/...). DefaultOpeningVfx regenerated WITH override (its base OpeningVfx is copied+abstract). Clearing the polymorphism cascade + the masking base-type CS0246s unmasked the true member-level frontier: 2202 (CS1501/CS1061/CS1503), 0 structural errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
146 lines
3.2 KiB
C#
146 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Wizard.Battle.View.Vfx;
|
|
|
|
namespace Wizard.Battle.Player.ClassCharacter;
|
|
|
|
public class SkinEffectVfx : VfxBase, IEffectVfx
|
|
{
|
|
private Func<EffectBattle> _getLoadedEffectObject;
|
|
|
|
protected EffectBattle _effectObject;
|
|
|
|
private Transform _targetTransform;
|
|
|
|
private int _order = -1;
|
|
|
|
private bool _isEvolve = true;
|
|
|
|
public bool IsEffectEnd { get; private set; }
|
|
|
|
public SkinEffectVfx(Func<EffectBattle> getLoadedEffectObject, Transform baseTransform, int order = -1, bool isEvolve = true)
|
|
{
|
|
if (BattleManagerBase.GetIns() == null || !BattleManagerBase.GetIns().IsRecovery)
|
|
{
|
|
_targetTransform = baseTransform;
|
|
_getLoadedEffectObject = getLoadedEffectObject;
|
|
_order = order;
|
|
_isEvolve = isEvolve;
|
|
}
|
|
}
|
|
|
|
public static void SetLayerAndOrder(GameObject gameObject, int layerNo, int order, bool needSetChildren = true)
|
|
{
|
|
if (gameObject == null)
|
|
{
|
|
return;
|
|
}
|
|
gameObject.layer = layerNo;
|
|
ParticleSystemRenderer component = gameObject.GetComponent<ParticleSystemRenderer>();
|
|
if (component != null)
|
|
{
|
|
component.sortingOrder = order;
|
|
}
|
|
if (!needSetChildren)
|
|
{
|
|
return;
|
|
}
|
|
foreach (Transform item in gameObject.transform)
|
|
{
|
|
SetLayerAndOrder(item.gameObject, layerNo, order, needSetChildren);
|
|
}
|
|
}
|
|
|
|
public override void Play()
|
|
{
|
|
if (BattleManagerBase.GetIns() != null && BattleManagerBase.GetIns().IsRecovery)
|
|
{
|
|
return;
|
|
}
|
|
base.Play();
|
|
_effectObject = _getLoadedEffectObject();
|
|
if (!(_effectObject == null))
|
|
{
|
|
_effectObject.GetComponent<ParticleSystemRenderer>();
|
|
SetLayerAndOrder(_effectObject.gameObject, _isEvolve ? 13 : 15, _order);
|
|
if (!_isEvolve)
|
|
{
|
|
SetMaskSetting(_effectObject.transform);
|
|
}
|
|
_effectObject.gameObject.SetActive(value: true);
|
|
IsEffectEnd = false;
|
|
IsEnd = true;
|
|
}
|
|
}
|
|
|
|
private void SetMaskSetting(Transform effectObject)
|
|
{
|
|
foreach (Transform item in effectObject)
|
|
{
|
|
ParticleSystemRenderer component = item.GetComponent<ParticleSystemRenderer>();
|
|
if (component != null)
|
|
{
|
|
component.maskInteraction = SpriteMaskInteraction.VisibleInsideMask;
|
|
}
|
|
SetMaskSetting(item);
|
|
}
|
|
}
|
|
|
|
public void UpdateEffect()
|
|
{
|
|
if (_effectObject == null)
|
|
{
|
|
IsEffectEnd = true;
|
|
}
|
|
else
|
|
{
|
|
RemoveCheck();
|
|
}
|
|
}
|
|
|
|
public void RemoveCheck()
|
|
{
|
|
if (CheckEffectEnd(_effectObject))
|
|
{
|
|
DestroyEffect();
|
|
}
|
|
}
|
|
|
|
public void DestroyEffect()
|
|
{
|
|
UnityEngine.Object.Destroy(_effectObject.gameObject);
|
|
IsEffectEnd = true;
|
|
}
|
|
|
|
public override void Update(float dt, List<IEffectVfx> effectVfxList)
|
|
{
|
|
base.Update(dt, effectVfxList);
|
|
if (IsEnd)
|
|
{
|
|
VfxMgr.CheckAndAddEffectVfxList(this, effectVfxList);
|
|
}
|
|
}
|
|
|
|
private bool CheckEffectEnd(EffectBattle effect)
|
|
{
|
|
if (effect.AnimationObj != null)
|
|
{
|
|
if (effect.AnimationObj.isPlaying)
|
|
{
|
|
return false;
|
|
}
|
|
effect.AnimationObj.gameObject.SetActive(value: false);
|
|
}
|
|
foreach (Transform item in effect.transform)
|
|
{
|
|
ParticleSystem component = item.GetComponent<ParticleSystem>();
|
|
if (component != null && component.IsAlive())
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
}
|