少年修仙传客户端代码仓库
lwb
2021-02-25 0d7482d5a0e8bf082abfb4b5bfbfee03597cdc3a
Utility/TransformExtension.cs
@@ -2,11 +2,11 @@
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)
@@ -16,7 +16,7 @@
    }
    //清空子物体
    [XLua.LuaCallCSharp]
    public static void ClearAllChilds(this Transform transform)
    {
        var count = transform.childCount;
@@ -30,7 +30,7 @@
        }
    }
    [XLua.LuaCallCSharp]
    public static void SetParentEx(this Transform transform, Transform parent, Vector3 localPosition, Quaternion rotation, Vector3 scale)
    {
@@ -43,7 +43,7 @@
        }
    }
    [XLua.LuaCallCSharp]
    public static void SetParentEx(this Transform transform, Transform parent, Vector3 localPosition, Vector3 eulerAngles, Vector3 scale)
    {
        if (transform != null && parent != null)
@@ -80,7 +80,7 @@
    }
    [XLua.LuaCallCSharp]
    public static Transform GetChildTransformDeeply(this Transform transform, string childName, bool includeSelf = false)
    {
@@ -122,7 +122,7 @@
    /// </summary>
    /// <param name="_child"></param>
    /// <param name="_parent"></param>
    [XLua.LuaCallCSharp]
    public static void MatchWhith(this RectTransform _child, RectTransform _parent)
    {
@@ -139,7 +139,7 @@
        _child.localScale = Vector3.one;
    }
    [XLua.LuaCallCSharp]
    public static bool ContainWorldPosition(this RectTransform _rectTransform, Vector3 _worldPosition)
    {
        var worldCorners = new Vector3[4];
@@ -153,7 +153,7 @@
        return false;
    }
    [XLua.LuaCallCSharp]
    public static bool RectTransformContain(this RectTransform _rectTransform, RectTransform _target)
    {
        var targetWorldCorners = new Vector3[4];
@@ -171,7 +171,7 @@
        return false;
    }
    [XLua.LuaCallCSharp]
    public static void SetPosition(this Transform transform, float x, float y, float z, bool isLocal = false)
    {
        if (transform == null)