Пример #1
0
    void Start()
    {
#if UNITY_EDITOR
        var time1 = DateTime.Now;
#endif
        GameObject proLifeGO = SFUtils.findChildWithParent(gameObject, "proLife");
        if (proLifeGO != null)
        {
            m_proLife = proLifeGO.GetComponent <SFProgressBar>();
        }

        GameObject lblUserNameGO = SFUtils.findChildWithParent(gameObject, "lblUserName");
        if (lblUserNameGO != null)
        {
            m_lblUserName = lblUserNameGO.GetComponent <Text>();
        }

        m_presenter = new SFUnitStatusItemPresenter() as ISFBasePresenter;

        m_presenter.initWithView(this);

#if UNITY_EDITOR
        var time2 = DateTime.Now;
        var diff  = time2.Subtract(time1);
        SFUtils.log(string.Format("View created: vwUnitStatusItem, cost {0}ms", diff.TotalMilliseconds));
#else
        SFUtils.log("View created: vwUnitStatusItem");
#endif
    }
Пример #2
0
    void Start()
    {
#if UNITY_EDITOR
        var time1 = DateTime.Now;
#endif
        GameObject lblPingGO = SFUtils.findChildWithParent(gameObject, "lblPing");
        if (lblPingGO != null)
        {
            m_lblPing = lblPingGO.GetComponent <Text>();
        }

        GameObject btnMenuGO = SFUtils.findChildWithParent(gameObject, "btnMenu");
        if (btnMenuGO != null)
        {
            m_btnMenu = btnMenuGO.GetComponent <Button>();
        }

        GameObject scrLeftPlayersGO = SFUtils.findChildWithParent(gameObject, "scrLeftPlayers");
        if (scrLeftPlayersGO != null)
        {
            m_scrLeftPlayers = scrLeftPlayersGO.GetComponent <ScrollRect>();
        }

        GameObject lblTimeGO = SFUtils.findChildWithParent(gameObject, "lblTime");
        if (lblTimeGO != null)
        {
            m_lblTime = lblTimeGO.GetComponent <Text>();
        }

        GameObject scrSkillsGO = SFUtils.findChildWithParent(gameObject, "scrSkills");
        if (scrSkillsGO != null)
        {
            m_scrSkills = scrSkillsGO.GetComponent <ScrollRect>();
        }

        GameObject proLifeGO = SFUtils.findChildWithParent(gameObject, "proLife");
        if (proLifeGO != null)
        {
            m_proLife = proLifeGO.GetComponent <SFProgressBar>();
        }

        m_presenter = new SFHUDPresenter() as ISFBasePresenter;

        m_presenter.initWithView(this);

#if UNITY_EDITOR
        var time2 = DateTime.Now;
        var diff  = time2.Subtract(time1);
        SFUtils.log(string.Format("View created: vwHUD, cost {0}ms", diff.TotalMilliseconds));
#else
        SFUtils.log("View created: vwHUD");
#endif
    }