public static void CallLuaFunc <T, P0, P1, P2, P3>(this T self, string name, P0 p0, P1 p1, P2 p2, P3 p3) where T : Component, ICapsUnityLuaBehavEx
    {
        CapsUnityLuaBehav major = GetMajorBehav(self);

        if (major != null)
        {
            major.BindLua();
            major.CallLuaFunc(name, p0, p1, p2, p3);
        }
    }
    public static void CallLuaFunc <T>(this T self, string name) where T : Component, ICapsUnityLuaBehavEx
    {
        CapsUnityLuaBehav major = GetMajorBehav(self);

        if (major != null)
        {
            major.BindLua();
            major.CallLuaFunc(name);
        }
    }
    public static object[] CallLuaFunc <T>(this T self, string name, params object[] args) where T : Component, ICapsUnityLuaBehavEx
    {
        CapsUnityLuaBehav major = GetMajorBehav(self);

        if (major != null)
        {
            major.BindLua();
            return(major.CallLuaFunc(name, args));
        }
        return(null);
    }
    public static bool CallLuaFunc <T, R, P0, P1, P2, P3, P4, P5>(this T self, string name, out R r, P0 p0, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5) where T : Component, ICapsUnityLuaBehavEx
    {
        CapsUnityLuaBehav major = GetMajorBehav(self);

        if (major != null)
        {
            major.BindLua();
            return(major.CallLuaFunc(name, out r, p0, p1, p2, p3, p4, p5));
        }
        r = default(R);
        return(false);
    }
    public static bool CallLuaFunc <T, R, P0>(this T self, string name, out R r, P0 p0) where T : Component, ICapsUnityLuaBehavEx
    {
        CapsUnityLuaBehav major = GetMajorBehav(self);

        if (major != null)
        {
            major.BindLua();
            return(major.CallLuaFunc(name, out r, p0));
        }
        r = default(R);
        return(false);
    }
        public override IntPtr PushLua(IntPtr l, object val)
        {
            var h = base.PushLua(l, val);

            LuaObjCache.RegObj(l, val, -1, h);
            CapsUnityLuaBehav real = val as CapsUnityLuaBehav;

            if (real != null)
            {
                if (real.ShouldBindLua)
                {
                    real.BindLua(l, -1);
                }
            }
            return(IntPtr.Zero);
        }