Beispiel #1
0
    /*public void Update()
     * {
     *      float scale = Mathf.Abs(Mathf.Sin(Time.timeSinceLevelLoad*0.5f+Mathf.PI*0.5f));
     *      transform.localScale = Vector3.one*scale;
     * }*/

    #endregion MoneBehaviourInterface

    // ==================================================================================================
    // === GUIBase_Wifget interaction ===================================================================

    #region GUIBase_Wifget interaction

    public override bool Callback(E_CallbackType type, object evt)
    {
        switch (type)
        {
        case E_CallbackType.E_CT_INIT:
        {
            m_Widget.ChangeMaterial(m_Font.fontMaterial);
            SetRegenerationNeeded();
        }
            return(true);
        }

        return(false);
    }
Beispiel #2
0
    void ChangeFont(GUIBase_FontBase inNewFont)
    {
        // destroy old text if any exist...
        m_FontXXX = inNewFont;
        SetRegenerationNeeded();

#if UNITY_EDITOR
        // this code can be only in editor. In real game m_Widget property has to be setup in start function...
        m_Widget = m_Widget ?? GetComponent <GUIBase_Widget>();
#endif

        m_Widget.ChangeMaterial(m_FontXXX.fontMaterial);
    }
Beispiel #3
0
    // ==================================================================================================
    // === GUIBase_Wifget interaction ===================================================================

    #region GUIBase_Wifget interaction

    public override bool Callback(E_CallbackType type, object evt)
    {
        switch (type)
        {
        case E_CallbackType.E_CT_INIT:
        {
            if (m_FontName == "Default")
            {
                m_FontName = "NewFont";                 // HACK, Don't use old 'default' font
            }
            m_Widget.ChangeMaterial(font.fontMaterial);
            SetRegenerationNeeded();
        }
            return(true);
        }

        return(false);
    }