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.
This commit is contained in:
90
SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs
Normal file
90
SVSim.BattleEngine/Engine/PlayerDrawCardToHandVfx.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class PlayerDrawCardToHandVfx : SequentialVfxPlayer
|
||||
{
|
||||
public class ChangePlayerHandCardParentVfx : VfxBase
|
||||
{
|
||||
private readonly IBattleCardView m_view;
|
||||
|
||||
public ChangePlayerHandCardParentVfx(IBattleCardView view)
|
||||
{
|
||||
m_view = view;
|
||||
}
|
||||
|
||||
public override void Play()
|
||||
{
|
||||
base.Play();
|
||||
m_view.GameObject.SetActive(value: false);
|
||||
m_view.GameObject.transform.parent = BattleManagerBase.GetIns().PCardPlace.transform;
|
||||
MotionUtils.SetLayerAll(m_view.GameObject, 10);
|
||||
m_view.GameObject.SetActive(value: true);
|
||||
IsEnd = true;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly BattleCardBase _card;
|
||||
|
||||
private const float ADD_CARD_TIME = 0.25f;
|
||||
|
||||
public PlayerDrawCardToHandVfx(BattleCardBase drawCard)
|
||||
{
|
||||
_card = drawCard;
|
||||
Register(Prepare());
|
||||
Register(WaitVfx.Create(0.25f));
|
||||
Register(OnHand());
|
||||
Register(InstantVfx.Create(delegate
|
||||
{
|
||||
_card.SetOnDraw(draw: false);
|
||||
}));
|
||||
}
|
||||
|
||||
private VfxBase Prepare()
|
||||
{
|
||||
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
GameObject pCardPlace = BattleManagerBase.GetIns().PCardPlace;
|
||||
_card.BattleCardView.GameObject.SetActive(value: false);
|
||||
_card.BattleCardView.GameObject.transform.parent = pCardPlace.transform;
|
||||
MotionUtils.SetLayerAll(_card.BattleCardView.GameObject, 10);
|
||||
_card.BattleCardView.GameObject.SetActive(value: true);
|
||||
}));
|
||||
if (_card.SelfBattlePlayer.HandCardList.Any((BattleCardBase c) => c == _card))
|
||||
{
|
||||
sequentialVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
if (!BattleManagerBase.GetIns().IsRecovery)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SET_CARD_TO_HAND);
|
||||
}
|
||||
_card.SelfBattlePlayer.BattleView.HandView.AddCardToView(_card.BattleCardView, 0.25f);
|
||||
_card.SelfBattlePlayer.HandControl.AttachCardView(_card.BattleCardView);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
sequentialVfxPlayer.Register(_card.DestroyInHand(null));
|
||||
}
|
||||
return sequentialVfxPlayer;
|
||||
}
|
||||
|
||||
private VfxBase OnHand()
|
||||
{
|
||||
if (_card.SelfBattlePlayer.HandCardList.Any((BattleCardBase c) => c == _card))
|
||||
{
|
||||
return ParallelVfxPlayer.Create(_card.BattleCardView.ShowHandCardInfo(), _card.CalcHandCost(), InstantVfx.Create(delegate
|
||||
{
|
||||
if (!BattleManagerBase.GetIns().IsRecovery)
|
||||
{
|
||||
GameMgr.GetIns().GetEffectMgr().Start(EffectMgr.EffectType.CMN_CARD_DRAW_2, _card.BattleCardView.GameObject.transform.position)
|
||||
.GetGameObjIns()
|
||||
.transform.rotation = _card.BattleCardView.GameObject.transform.rotation;
|
||||
}
|
||||
}));
|
||||
}
|
||||
return NullVfx.GetInstance();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user