InformationSaveAndAudioCore_Over
This commit is contained in:
39
Assets/02.InformationSave/RunTime/CameraInfo.cs
Normal file
39
Assets/02.InformationSave/RunTime/CameraInfo.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.InformationSave
|
||||
{
|
||||
public class CameraInfo : AbstractInformation<CameraInfo.Information>
|
||||
{
|
||||
public override void Save(int index)
|
||||
{
|
||||
var c = GetComponent<Camera>();
|
||||
var tf = transform;
|
||||
_list[index].position = tf.position.GetVector3Data();
|
||||
_list[index].eulerAngles = tf.eulerAngles.GetVector3Data();
|
||||
_list[index].orthographic = c.orthographic;
|
||||
_list[index].orthographicSize = c.orthographicSize;
|
||||
_list[index].fieldofView = c.fieldOfView;
|
||||
}
|
||||
|
||||
public override void Switch(int index)
|
||||
{
|
||||
var c = GetComponent<Camera>();
|
||||
var tf = transform;
|
||||
tf.position = _list[index].position.SetVector3Data();
|
||||
tf.eulerAngles = _list[index].eulerAngles.SetVector3Data();
|
||||
c.orthographic = _list[index].orthographic;
|
||||
c.orthographicSize = _list[index].orthographicSize;
|
||||
c.fieldOfView = _list[index].fieldofView;
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public sealed class Information : InformationBase
|
||||
{
|
||||
public Vector3Data position;
|
||||
public Vector3Data eulerAngles;
|
||||
public bool orthographic;
|
||||
public float orthographicSize;
|
||||
public float fieldofView;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user