예제 #1
0
    public MFUIButtonHandler RegisterButtonHandler(string name, Transform rootTran = null)
    {
        MFUIButtonHandler bh;

        if (m_dictButtonAction.ContainsKey(name))
        {
            MFUIUtils.MFUIDebug(string.Concat(name, " is Already in the buttonHandler Dict ! Now Instead it of this !"));
        }

        if (rootTran == null)
        {
            bh = m_myTransform.Find(MFUIUtils.GetFullName(name)).GetComponentsInChildren <MFUIButtonHandler>(true)[0];
        }
        else
        {
            bh = rootTran.Find(name).GetComponentsInChildren <MFUIButtonHandler>(true)[0];
        }

        m_dictButtonAction[name] = bh;

        return(bh);
    }
예제 #2
0
    public UISprite RegisterSprite(string name, Transform rootTran = null)
    {
        UISprite sp;

        if (m_dictSprite.ContainsKey(name))
        {
            MFUIUtils.MFUIDebug(string.Concat(name, " is Already in the Sprite Dict ! Now Instead it of this !"));
        }

        if (rootTran == null)
        {
            sp = m_myTransform.Find(MFUIUtils.GetFullName(name)).GetComponentsInChildren <UISprite>(true)[0];
        }
        else
        {
            sp = rootTran.Find(name).GetComponentsInChildren <UISprite>(true)[0];
        }

        m_dictSprite[name] = sp;

        return(sp);
    }
예제 #3
0
    public UITexture RegisterTexture(string name, Transform rootTran = null)
    {
        UITexture tex;

        if (m_dictTexture.ContainsKey(name))
        {
            MFUIUtils.MFUIDebug(string.Concat(name, " is Already in the Texture Dict ! Now Instead it of this !"));
        }

        if (rootTran == null)
        {
            tex = m_myTransform.Find(MFUIUtils.GetFullName(name)).GetComponentsInChildren <UITexture>(true)[0];
        }
        else
        {
            tex = rootTran.Find(name).GetComponentsInChildren <UITexture>(true)[0];
        }

        m_dictTexture[name] = tex;

        return(tex);
    }
예제 #4
0
    public UILabel RegisterLabel(string name, Transform rootTran = null)
    {
        UILabel lbl;

        if (m_dictLabel.ContainsKey(name))
        {
            MFUIUtils.MFUIDebug(string.Concat(name, " is Already in the Label Dict ! Now Instead it of this !"));
        }

        if (rootTran == null)
        {
            lbl = m_myTransform.Find(MFUIUtils.GetFullName(name)).GetComponentsInChildren <UILabel>(true)[0];
        }
        else
        {
            lbl = rootTran.Find(name).GetComponentsInChildren <UILabel>(true)[0];
        }

        m_dictLabel[name] = lbl;

        return(lbl);
    }