public void SetTipImg(int mark)
    {
        string texName;

        switch (mark)
        {
        case 1:
            texName = "fb-dc";
            break;

        case 2:
            texName = "fb-db";
            break;

        case 3:
            texName = "fb-da";
            break;

        case 4:
            texName = "fb-ds";
            break;

        default:
            texName = "fb-dc";
            break;
        }
        if (GetTexture("BattlePassCardListUICardListTipImg").mainTexture.name != texName)
        {
            MFUIResourceManager.GetSingleton().LoadResource(ID, string.Concat(texName, ".png"), (obj) =>
            {
                SetTexture("BattlePassCardListUICardListTipImg", (Texture)obj);
            });
        }
    }
Ejemplo n.º 2
0
    public void SetGrade(int grade)
    {
        string texName;

        switch (grade)
        {
        case 0:
            texName = "fb-ds";
            break;

        case 1:
            texName = "fb-da";
            break;

        case 2:
            texName = "fb-db";
            break;

        default:
            texName = "fb-dc";
            break;
        }
        if (GetTexture("NewBattleRewardUIGrade").mainTexture.name != texName)
        {
            MFUIResourceManager.GetSingleton().LoadResource(ID, string.Concat(texName, ".png"), (obj) =>
            {
                SetTexture("NewBattleRewardUIGrade", (Texture)obj);
            });
        }
    }
Ejemplo n.º 3
0
    private void RegisterGameObject(MFUIManager.MFUIID id, string path, string goName, bool preLoad = false)
    {
        if (!m_listResPathToPoolUnit.ContainsKey(path))
        {
            List <MFUIGameObjectPoolUnit> listUnit = new List <MFUIGameObjectPoolUnit>();

            m_listResPathToPoolUnit.Add(path, listUnit);

            MFUIResourceManager.GetSingleton().LoadInstance(id, path, goName, preLoad);
        }
        else
        {
            //Debug.LogError("LoadResouce " + path);
            List <MFUIGameObjectPoolUnit> listUnit = m_listResPathToPoolUnit[path];

            for (int i = 0; i < listUnit.Count; ++i)
            {
                if (listUnit[i].isFree)
                {
                    listUnit[i].isFree        = false;
                    listUnit[i].poolUnit.name = goName;
                    MFUIGameObjectPool.GetSingleton().ResourceLoaded(goName);
                    return;
                }
            }

            MFUIResourceManager.GetSingleton().LoadInstance(id, path, goName, preLoad);
        }
    }
Ejemplo n.º 4
0
    public static MFUIResourceManager GetSingleton()
    {
        if (m_singleton == null)
        {
            m_singleton = new MFUIResourceManager();
        }

        return m_singleton;
    }
Ejemplo n.º 5
0
    public static MFUIResourceManager GetSingleton()
    {
        if (m_singleton == null)
        {
            m_singleton = new MFUIResourceManager();
        }

        return(m_singleton);
    }
Ejemplo n.º 6
0
    public void ReleaseRuneUI(GameObject go)
    {
        if (MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.ContainsKey("RuneUI.prefab"))
        {
            MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.Remove("RuneUI.prefab");
        }

        MFUIResourceManager.GetSingleton().ReleasePreLoadResource(MFUIID.RuneUI);
        GameObject.Destroy(go);
        ReleaseUI(MFUIID.RuneUI);
    }
Ejemplo n.º 7
0
    //public void DetachAllBasedUI(MFUIID id)
    //{
    //    Debug.LogError(DictUIBaseIDToTargetID.Count);

    //    foreach (var item in DictUIBaseIDToTargetID)
    //    {
    //        Debug.LogError(item.Key + " " + item.Value[0]);
    //    }

    //    if (DictUIBaseIDToTargetID.ContainsKey(id))
    //    {
    //        for (int i = 0; i < DictUIBaseIDToTargetID[id].Count; ++i)
    //        {
    //            Debug.LogError(DictUIIDToOBj[DictUIBaseIDToTargetID[id][i]].name+" @@@@@@@@@@@@@@@@@@@@");
    //            DictUIIDToOBj[DictUIBaseIDToTargetID[id][i]].GetComponentsInChildren<MFUIUnit>(true)[0].Hide();
    //        }

    //        DictUIBaseIDToTargetID.Remove(id);
    //    }
    //}

    //填坑函数

    public void ReleaseDragonUI(GameObject go)
    {
        if (MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.ContainsKey("DragonUI.prefab"))
        {
            MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.Remove("DragonUI.prefab");
        }
        MFUIResourceManager.GetSingleton().ReleasePreLoadResource(MFUIID.DragonUI);
        //AssetCacheMgr.ReleaseInstance(go);
        GameObject.Destroy(go);
        ReleaseUI(MFUIID.DragonUI);
    }
Ejemplo n.º 8
0
    public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID         = MFUIManager.MFUIID.DragonUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);

        MFUIResourceManager.GetSingleton().PreLoadResource("DragonUIGridInfotest.prefab", ID);
        MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_qiu.prefab", ID);
        MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_jb.prefab", ID);

        MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(MFUIManager.MFUIID.DragonUI);

        MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
        m_myGameObject.name = "DragonUI";
    }
Ejemplo n.º 9
0
 public void UnLoadResources()
 {
     CallWhenUnloadResources();
     MFUIResourceManager.GetSingleton().ReleasePreLoadResource(ID);
 }