示例#1
0
    //[MenuItem("UI/YlyRichText", false, 0)]
    public static void CreateYlyRichTextGo()
    {
        UnityEngine.Object[] selObjs = Selection.GetFiltered(typeof(UnityEngine.GameObject), SelectionMode.TopLevel);
        if (selObjs == null || selObjs.Length == 0)
        {
            return;
        }

        GameObject parentGo = (GameObject)selObjs[0];

        if (PrefabUtility.GetPrefabType(parentGo) == PrefabType.Prefab || PrefabUtility.GetPrefabType(parentGo) == PrefabType.ModelPrefab)
        {
            return;
        }

        GameObject ylyRichTextGo = new GameObject("YlyRichText");

        ylyRichTextGo.transform.SetParent(parentGo.transform, false);

        YlyRichText   ylyRichTextC = ylyRichTextGo.AddComponent <YlyRichText>();
        RectTransform rt           = ylyRichTextGo.GetComponent <RectTransform>();

        rt.sizeDelta = new Vector2(160f, 60f);

        Selection.activeGameObject = ylyRichTextGo;
    }
示例#2
0
    static int set_onLinkClick(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            YlyDelegateUtil.StringDelegate arg0 = null;
            LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (YlyDelegateUtil.StringDelegate)ToLua.CheckObject(L, 2, typeof(YlyDelegateUtil.StringDelegate));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(YlyDelegateUtil.StringDelegate), func) as YlyDelegateUtil.StringDelegate;
            }

            obj.onLinkClick = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onLinkClick on a nil value" : e.Message));
        }
    }
示例#3
0
 static int CalculateLayoutInputVertical(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         YlyRichText obj = (YlyRichText)ToLua.CheckObject(L, 1, typeof(YlyRichText));
         obj.CalculateLayoutInputVertical();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#4
0
 static int OnPointerClick(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         YlyRichText obj = (YlyRichText)ToLua.CheckObject(L, 1, typeof(YlyRichText));
         UnityEngine.EventSystems.PointerEventData arg0 = (UnityEngine.EventSystems.PointerEventData)ToLua.CheckObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData));
         obj.OnPointerClick(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#5
0
    static int set_color(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText       obj  = (YlyRichText)o;
            UnityEngine.Color arg0 = ToLua.ToColor(L, 2);
            obj.color = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index color on a nil value" : e.Message));
        }
    }
示例#6
0
    static int set_font(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText      obj  = (YlyRichText)o;
            UnityEngine.Font arg0 = (UnityEngine.Font)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.Font));
            obj.font = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index font on a nil value" : e.Message));
        }
    }
示例#7
0
    static int get_uylytext(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIAutoSize  obj = (UIAutoSize)o;
            YlyRichText ret = obj.uylytext;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uylytext on a nil value" : e.Message));
        }
    }
示例#8
0
    static int set_isAutoAdaptiveWidthHeight(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj  = (YlyRichText)o;
            bool        arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.isAutoAdaptiveWidthHeight = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isAutoAdaptiveWidthHeight on a nil value" : e.Message));
        }
    }
示例#9
0
    static int get_mainTexture(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText         obj = (YlyRichText)o;
            UnityEngine.Texture ret = obj.mainTexture;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index mainTexture on a nil value" : e.Message));
        }
    }
示例#10
0
    static int get_enableRichText(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            bool        ret = obj.enableRichText;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index enableRichText on a nil value" : e.Message));
        }
    }
示例#11
0
    static int get_verticalOverflow(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            UnityEngine.VerticalWrapMode ret = obj.verticalOverflow;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index verticalOverflow on a nil value" : e.Message));
        }
    }
示例#12
0
    static int get_outLineColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText         obj = (YlyRichText)o;
            UnityEngine.Color32 ret = obj.outLineColor;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index outLineColor on a nil value" : e.Message));
        }
    }
示例#13
0
    static int get_onLinkClick(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            YlyDelegateUtil.StringDelegate ret = obj.onLinkClick;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onLinkClick on a nil value" : e.Message));
        }
    }
示例#14
0
    static int set_verticalOverflow(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            UnityEngine.VerticalWrapMode arg0 = (UnityEngine.VerticalWrapMode)ToLua.CheckObject(L, 2, typeof(UnityEngine.VerticalWrapMode));
            obj.verticalOverflow = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index verticalOverflow on a nil value" : e.Message));
        }
    }
示例#15
0
    static int set_outLineColor(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText         obj  = (YlyRichText)o;
            UnityEngine.Color32 arg0 = (UnityEngine.Color32)ToLua.CheckObject(L, 2, typeof(UnityEngine.Color32));
            obj.outLineColor = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index outLineColor on a nil value" : e.Message));
        }
    }
示例#16
0
    static int set_text(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj  = (YlyRichText)o;
            string      arg0 = ToLua.CheckString(L, 2);
            obj.text = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index text on a nil value" : e.Message));
        }
    }
示例#17
0
    static int set_maxChars(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj  = (YlyRichText)o;
            int         arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.maxChars = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index maxChars on a nil value" : e.Message));
        }
    }
示例#18
0
    static int get_layoutPriority(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            int         ret = obj.layoutPriority;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index layoutPriority on a nil value" : e.Message));
        }
    }
示例#19
0
    static int set_customWidthToNewLine(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj  = (YlyRichText)o;
            float       arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.customWidthToNewLine = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index customWidthToNewLine on a nil value" : e.Message));
        }
    }
示例#20
0
    static int get_preferredWidth(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YlyRichText obj = (YlyRichText)o;
            float       ret = obj.preferredWidth;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index preferredWidth on a nil value" : e.Message));
        }
    }
示例#21
0
    static int set_uylytext(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UIAutoSize  obj  = (UIAutoSize)o;
            YlyRichText arg0 = (YlyRichText)ToLua.CheckUnityObject(L, 2, typeof(YlyRichText));
            obj.uylytext = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index uylytext on a nil value" : e.Message));
        }
    }
示例#22
0
 protected override void OnEnable()
 {
     base.OnEnable();
     _target                   = target as YlyRichText;
     text                      = serializedObject.FindProperty("m_Text");
     fontSize                  = serializedObject.FindProperty("m_FontSize");
     lineHeght                 = serializedObject.FindProperty("m_LineHeght");
     lineSpacing               = serializedObject.FindProperty("m_LineSpacing");
     offCharX                  = serializedObject.FindProperty("m_OffCharX");
     maxChars                  = serializedObject.FindProperty("m_MaxChars");
     isCustomWidthToNewLine    = serializedObject.FindProperty("m_IsCustomWidthToNewLine");
     customWidthToNewLine      = serializedObject.FindProperty("m_CustomWidthToNewLine");
     isNeedOutLine             = serializedObject.FindProperty("m_IsNeedOutLine");
     outLineColor              = serializedObject.FindProperty("m_OutLineColor");
     isAutoAdaptiveWidthHeight = serializedObject.FindProperty("m_IsAutoAdaptiveWidthHeight");
     horizontalOverflow        = serializedObject.FindProperty("m_HorizontalOverflow");
     verticalOverflow          = serializedObject.FindProperty("m_VerticalOverflow");
     textColor                 = serializedObject.FindProperty("m_TColor");
     alignment                 = serializedObject.FindProperty("m_Alignment");
     enableRichText            = serializedObject.FindProperty("m_EnableRichText");
 }