| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | |
| | | public static class TransformExtension |
| | | { |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | |
| | | public static void Destroy(this Transform transform) |
| | | { |
| | | if (Application.isPlaying) |
| | |
| | | } |
| | | |
| | | //清空子物体 |
| | | [XLua.LuaCallCSharp] |
| | | |
| | | public static void ClearAllChilds(this Transform transform) |
| | | { |
| | | var count = transform.childCount; |
| | |
| | | } |
| | | } |
| | | |
| | | [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) |
| | |
| | | |
| | | } |
| | | |
| | | [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]; |
| | |
| | | return false; |
| | | } |
| | | |
| | | [XLua.LuaCallCSharp] |
| | | |
| | | public static void SetPosition(this Transform transform, float x, float y, float z, bool isLocal = false) |
| | | { |
| | | if (transform == null) |