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