feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
This commit is contained in:
79
SVSim.BattleEngine/Engine/BattleCamera.cs
Normal file
79
SVSim.BattleEngine/Engine/BattleCamera.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using Wizard.Battle.View.Vfx;
|
||||
|
||||
public class BattleCamera
|
||||
{
|
||||
public UICamera m_CutInCamera;
|
||||
|
||||
public Camera Camera;
|
||||
|
||||
public Camera _backgroundCamera;
|
||||
|
||||
public Vector3 BattleCameraPos { get; private set; }
|
||||
|
||||
public Vector3 BattleCameraRot { get; private set; }
|
||||
|
||||
public BattleCamera()
|
||||
{
|
||||
Camera = null;
|
||||
}
|
||||
|
||||
public void SetUp(Camera camera, UICamera cutInCamera, Camera backgroundCamera)
|
||||
{
|
||||
Camera = camera;
|
||||
m_CutInCamera = cutInCamera;
|
||||
_backgroundCamera = backgroundCamera;
|
||||
BattleCameraPos = Camera.transform.localPosition;
|
||||
BattleCameraRot = Camera.transform.eulerAngles;
|
||||
}
|
||||
|
||||
public VfxBase ShakeCamera(Vector3 amount, float time, float delay)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
parallelVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
iTween.ShakePosition(Camera.gameObject, iTween.Hash("amount", amount, "time", time, "delay", delay));
|
||||
}));
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public static VfxBase ShakeCameraGameObject(GameObject obj, Vector3 amount, float time, float delay)
|
||||
{
|
||||
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
|
||||
parallelVfxPlayer.Register(InstantVfx.Create(delegate
|
||||
{
|
||||
iTween.ShakePosition(obj, iTween.Hash("amount", amount, "time", time, "delay", delay));
|
||||
}));
|
||||
return parallelVfxPlayer;
|
||||
}
|
||||
|
||||
public VfxBase ShakeComplete()
|
||||
{
|
||||
return InstantVfx.Create(delegate
|
||||
{
|
||||
Camera.transform.localPosition = BattleCameraPos;
|
||||
Camera.transform.eulerAngles = BattleCameraRot;
|
||||
iTween.Stop(Camera.gameObject);
|
||||
});
|
||||
}
|
||||
|
||||
public static VfxBase ShakeCompleteGameObject(GameObject obj, Vector3 position, Vector3 euler)
|
||||
{
|
||||
return InstantVfx.Create(delegate
|
||||
{
|
||||
obj.transform.localPosition = position;
|
||||
obj.transform.eulerAngles = euler;
|
||||
iTween.Stop(obj);
|
||||
});
|
||||
}
|
||||
|
||||
public Camera Get3DCamera()
|
||||
{
|
||||
return Camera;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Camera = null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user