31 lines
999 B
C#
31 lines
999 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace Stary.Evo.InformationSave
|
||
|
|
{
|
||
|
|
public class TransformInfo : AbstractInformation<TransformInfo.Information>
|
||
|
|
{
|
||
|
|
public override void Save(int index)
|
||
|
|
{
|
||
|
|
var tf = transform;
|
||
|
|
_list[index].position =tf.position.GetVector3Data();
|
||
|
|
_list[index].eulerAngles = tf.eulerAngles.GetVector3Data();
|
||
|
|
_list[index].localScale = tf.localScale.GetVector3Data();
|
||
|
|
}
|
||
|
|
|
||
|
|
public override void Switch(int index)
|
||
|
|
{
|
||
|
|
var tf = transform;
|
||
|
|
tf.position = _list[index].position.SetVector3Data();
|
||
|
|
tf.eulerAngles =_list[index].eulerAngles.SetVector3Data();
|
||
|
|
tf.localScale = _list[index].localScale.SetVector3Data();
|
||
|
|
}
|
||
|
|
|
||
|
|
[System.Serializable]
|
||
|
|
public sealed class Information : InformationBase
|
||
|
|
{
|
||
|
|
public Vector3Data position;
|
||
|
|
public Vector3Data eulerAngles;
|
||
|
|
public Vector3Data localScale;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|