SanAndreasUnity/Assets/Scripts/Settings/CameraSettings.cs

35 lines
880 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using UnityEngine;
using SanAndreasUnity.UI;
namespace SanAndreasUnity.Settings {
public class CameraSettings : MonoBehaviour {
OptionsWindow.FloatInput m_farClipPlaneInput = new OptionsWindow.FloatInput() {
description = "Far clip plane",
minValue = 100,
maxValue = 5000,
isAvailable = () => Camera.main != null,
getValue = () => Camera.main.farClipPlane,
setValue = (value) => { Camera.main.farClipPlane = value; },
};
OptionsWindow.FloatInput m_fieldOfViewInput = new OptionsWindow.FloatInput() {
description = "Field of view",
minValue = 20,
maxValue = 120,
isAvailable = () => Camera.main != null,
getValue = () => Camera.main.fieldOfView,
setValue = (value) => { Camera.main.fieldOfView = value; },
};
void Awake ()
{
OptionsWindow.RegisterInputs ("CAMERA", m_farClipPlaneInput, m_fieldOfViewInput);
}
}
}