Esempio n. 1
0
        protected virtual void HudLoadComplete(bool NoError, string[] Show)
        {
            if (Show != null)
            {
                StringBuilder str = new StringBuilder();
                for (int i = 0; i < Show.Length; ++i)
                {
                    str.Append("[" + i + "]:" + Show[i]);

                    HudRootEntry entry = HudLoadManager.GetHudRoot(Show[i]);
                    entry.Show();
                    UIHierarchyHelper.Instance.Place(entry.m_Root, UIHierarchyHelper.eUIType.HUD_Dynamic, UIAnchor.Side.Center);
                }
                EB.Debug.LogUI("【<color=#00ff00>{0}</color>】加载UI界面:<color=#00ff00>{1}</color>: result = <color=#00ff00>{2}</color>", GameFlowHotfixController.ActiveStateName, str, NoError);
            }
            else
            {
                EB.Debug.LogError(string.Format("[{0}]HudLoadComplete: There is nothing to show.", GameFlowHotfixController.ActiveStateName));
            }

            if (onLoadComplete != null)
            {
                onLoadComplete(NoError);
                onLoadComplete = null;
            }
        }
Esempio n. 2
0
    //--------------------------------------------------------------------------------------------------
    //  Function: DestroyHud
    //
    //  Description:
    //--------------------------------------------------------------------------------------------------
    static bool DestroyHud(string hudName)
    {
        HudRootEntry entry = null;

        m_HudRootDict.TryGetValue(hudName, out entry);
        if (entry != null)
        {
            entry.DestroyHud();
            return(true);
        }
        else
        {
            EB.Debug.LogError("[HudLoadManager]DestroyHud: There is no definition of hud [" + hudName + "]. ");
        }
        return(false);
    }
Esempio n. 3
0
    //--------------------------------------------------------------------------------------------------
    //  Function: LoadHudAsyncImpl
    //
    //  Description:
    //--------------------------------------------------------------------------------------------------
    static bool LoadHudAsyncImpl(string assetName, HudRootEntry.Failed failed, HudRootEntry.Finished finish)
    {
        if (!m_HudRootDict.ContainsKey(assetName))
        {
            m_HudRootDict.Add(assetName, new HudRootEntry(assetName));
        }

        HudRootEntry entry = null;

        m_HudRootDict.TryGetValue(assetName, out entry);
        if (entry != null && entry.OnFinished != finish && entry.OnFailed != failed)
        {
            entry.LoadHudAsync(assetName, failed, finish);
            return(true);
        }

        return(false);
    }