//======================================================= // 作者:王则昆 // 描述: //======================================================= using UnityEngine; namespace Stary.Evo.InformationSave { public static class AnchoredPositionExtension { public static AnchoredPosition.Information GetAnchoredPositionInformation(this RectTransform tf, string desc) { return tf.GetComponent()._list.Find(n => n.desc == desc); } public static Vector3 GetAnchoredPosition(this RectTransform tf, string desc) { return GetAnchoredPositionInformation(tf, desc).anchoredPosition.SetVector2Data(); } public static void SetAnchoredPosition(this RectTransform tf, string desc) { tf.GetComponent().Set(desc); } public static AnchoredPosition.Information GetAnchoredPositionInformation(this Transform tf, string desc) { return tf.GetComponent()._list.Find(n => n.desc == desc); } public static Vector3 GetAnchoredPosition(this Transform tf, string desc) { return GetAnchoredPositionInformation(tf, desc).anchoredPosition.SetVector2Data(); } public static void SetAnchoredPosition(this Transform tf, string desc) { tf.GetComponent().Set(desc); } } }