Files
plugin-library/Assets/02.InformationSave/RunTime/Extension/LocalEulerAnglesExtension.cs
2025-03-26 09:34:52 +08:00

22 lines
700 B
C#

using UnityEngine;
namespace Stary.Evo.InformationSave
{
public static class LocalEulerAnglesExtension
{
public static LocalEulerAngles.Information GetLocalEulerAnglesInformation(this Transform tf, string desc)
{
return tf.GetComponent<LocalEulerAngles>()._list.Find(n => n.desc == desc);
}
public static Vector3 GetLocalEulerAngles(this Transform tf, string desc)
{
return GetLocalEulerAnglesInformation(tf, desc).localEulerAngles.SetVector3Data();
}
public static void SetLocalEulerAngles(this Transform tf, string desc)
{
tf.GetComponent<LocalEulerAngles>().Set(desc);
}
}
}