示例#1
0
    public List <Type> GetLinkedList(Type type, List <Type> list = null)
    {
        UiRelationData relation = GetUiRelationData(type);

        if (relation != null)
        {
            List <Type> relationList = null;
            if (list == null)
            {
                relationList = new List <Type>();
            }
            else
            {
                relationList = list;
            }

            if (relation.linkedTypes != null)
            {
                GetLinkedUis(type, relationList);
            }
            else
            {
                relationList.Add(type);
            }

            return(relationList);
        }
        return(null);
    }
示例#2
0
    private void Preload()
    {
        PreloadData    data     = cityPreloadList[curLoadIndex];
        UiRelationData relation = UiRelations.Instance.GetUiRelationData(data.uiType);

        UiUtility.LoadUiPerfab(data.uiType, relation.resourceName);
        data.loadState = PreloadState.Done;
        if (!CheckLoadOver())
        {
            curLoadIndex++;
            Invoke("Preload", loadRate);
        }
    }
示例#3
0
    private void GetLinkedUis(Type type, List <Type> linkedUis)
    {
        if (linkedUis != null && (!linkedUis.Contains(type)))
        {
            linkedUis.Add(type);
        }

        UiRelationData relation = GetUiRelationData(type);

        if (relation != null && relation.linkedTypes != null)
        {
            for (int i = 0; i < relation.linkedTypes.Length; i++)
            {
                GetLinkedUis(relation.linkedTypes[i], linkedUis);
            }
        }
    }
示例#4
0
    /// <summary>
    /// 这个创建ui, prefab本身已经绑定了脚本, 但是也没有调用BaseUi的BlandGameObjectLinkIfDidnt方法啊???
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    private BaseUi Create(Type type)
    {
        UiRelationData relation = UiRelations.Instance.GetUiRelationData(type);

        if (relation == null)
        {
            LoggerManager.Instance.Error("Create ui type: {0} cannot find.", type);
            return(null);
        }
        BaseUi ui = UiUtility.LoadUiPerfab(relation.type, relation.resourceName);

        if (ui != null)
        {
            ui.UiPanelName = relation.resourceName;
            InitUi(ui);
        }
        return(ui);
    }
示例#5
0
    /// <summary>
    /// 注册所有的ui实例
    /// </summary>
    /// <param name="type"></param>
    /// <param name="resourceName"></param>
    /// <param name="linkedTypes"></param>
    /// <param name="hideOtherModules"></param>
    /// <param name="igoreMutexTypes"></param>
    /// <returns></returns>
    public bool Register(Type type, string resourceName, Type[] linkedTypes, bool hideOtherModules, Type[] igoreMutexTypes)
    {
        if (relationDic.ContainsKey(type))
        {
            return(false);
        }

        UiRelationData relation = new UiRelationData();

        relation.type             = type;
        relation.resourceName     = resourceName;
        relation.linkedTypes      = linkedTypes;
        relation.ignoreMutexTypes = igoreMutexTypes;
        relation.hideOtherModules = hideOtherModules;

        relationList.Add(relation);
        relationDic.Add(type, relation);

        return(true);
    }