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.
45 lines
778 B
C#
45 lines
778 B
C#
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;
|
|
}
|
|
}
|
|
}
|