feat(battle-engine): close the AI-simulation subsystem (verbatim)
Copied the 89 uncopied AI*SimulationUtility/extension files defining the AIVirtualCard/AIVirtualField extension methods; the compile loop then auto-closed the revealed type deps (~3049 files total, drift-clean). 10.0k -> 62 errors.
This commit is contained in:
44
SVSim.BattleEngine/Engine/AspectCameraPerspective.cs
Normal file
44
SVSim.BattleEngine/Engine/AspectCameraPerspective.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class AspectCameraPerspective : MonoBehaviour
|
||||
{
|
||||
private Camera m_camera;
|
||||
|
||||
private bool m_isSetFOV;
|
||||
|
||||
public void UpdateFov()
|
||||
{
|
||||
m_isSetFOV = false;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_camera = GetComponent<Camera>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (!m_isSetFOV && GameMgr.GetIns() != null && m_camera != null)
|
||||
{
|
||||
float num = 0f;
|
||||
float num2 = 0f;
|
||||
if (Screen.width > Screen.height)
|
||||
{
|
||||
num = Screen.width;
|
||||
num2 = Screen.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
num = Screen.height;
|
||||
num2 = Screen.width;
|
||||
}
|
||||
float num3 = num / num2;
|
||||
if (num3 > 1.7777778f)
|
||||
{
|
||||
num3 = 1.7777778f;
|
||||
}
|
||||
m_camera.fieldOfView = Mathf.Atan2(1f, num3) * 57.29578f * 2f;
|
||||
m_isSetFOV = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user