| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static class TransformExtension |
| | | { |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static void SetParentEx(this Transform transform, Transform parent, Vector3 localPosition, Quaternion rotation, Vector3 scale) |
| | | { |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static void SetParentEx(this Transform transform, Transform parent, Vector3 localPosition, Vector3 eulerAngles, Vector3 scale) |
| | | { |
| | | if (transform != null && parent != null) |
| | |
| | | transform.localScale = scale; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static T[] GetComponentsInChildren<T>(this Transform transform, bool includeInactive, bool includeSelf) where T : Component |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static Transform GetChildTransformDeeply(this Transform transform, string childName, bool includeSelf = false) |
| | | { |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="_child"></param> |
| | | /// <param name="_parent"></param> |
| | | [XLua.LuaCallCSharp] |
| | | public static void MatchWhith(this RectTransform _child, RectTransform _parent) |
| | | { |
| | | |
| | |
| | | _child.localScale = Vector3.one; |
| | | } |
| | | |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static bool ContainWorldPosition(this RectTransform _rectTransform, Vector3 _worldPosition) |
| | | { |
| | | var worldCorners = new Vector3[4]; |
| | |
| | | return false; |
| | | } |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | public static bool RectTransformContain(this RectTransform _rectTransform, RectTransform _target) |
| | | { |
| | | var targetWorldCorners = new Vector3[4]; |