Пример #1
0
    // MONOBEHAVIOUR INTERFACE

    void Awake()
    {
        Widget = GetComponent <GUIBase_Widget>();
        if (Widget == null)
        {
            Debug.LogWarning("There is NOT any widget specified for MultiSprite '" + MFDebugUtils.GetFullName(gameObject) + "'!");
            return;
        }
        Widget.CreateMainSprite = true;
    }
Пример #2
0
    //---------------------------------------------------------
    public bool GenerateRunTimeData()
    {
        bool regenerated = IsDataRegenerationNeaded();

        if (regenerated)
        {
            //RebuildRuntimeData();
            if (font == null)
            {
                Debug.LogWarning("GUIBase_Label have not a font assigned " + MFDebugUtils.GetFullName(gameObject));
            }
            else
            {
                GUIBase_Widget widget = GetComponent <GUIBase_Widget>();

                m_TextDyn         = null;
                m_TextIDGenerated = 0;
                if (m_TextID != 0)
                {
                    m_TextDyn = m_AllowMultiline == true ? TextDatabase.instance[m_TextID] : TextDatabase.instance[m_TextID].Replace("\n", " ");
#if UNITY_EDITOR
                    if (m_TextDyn == "<UNKNOWN TEXT>")
                    {
                        Debug.Log("Invalid text id on gameobject " + gameObject.GetFullName());
                    }
#endif

                    m_TextIDGenerated = m_TextID;
                }
#if UNITY_EDITOR
                m_ReloadCount = TextDatabase.instance.reloadCount;
#endif

                Texture2D texture   = fontTexture;
                float     texHeight = texture.height;
                Vector2   textSize  = GetTextSize();

                widget.SetScreenSize(textSize.x, textSize.y * texHeight);
#if UNITY_EDITOR
                m_AnchorPointGen     = (int)m_AnchorPoint;
                m_AlignmentGen       = (int)m_Alignment;
                m_LineSpaceGenerated = m_LineSpace2;
                m_UseFontExGen       = useFontEx;
#endif
            }
        }

        return(regenerated);
    }