Ejemplo n.º 1
0
    private bool LoadTable(string tablename, Type type)
    {
        if (gameTable.ContainsKey(tablename) == true)
        {
            Debug.Log("Load table is error!!! Had a file! Name=" + tablename);
            return(false);
        }

        TextAsset o = Resources.Load("Configs/" + tablename) as TextAsset;

        if (o == null)
        {
            Debug.Log("Load table is error!!!Read File is error! File=" + tablename);
            return(false);
        }

        GameTable tab = GameTable.Clone(type);

        tab.name = o.name;

        ReadTable(o.bytes, ref tab);

        gameTable.Add(tab.name, tab);
        return(true);
    }
Ejemplo n.º 2
0
    private bool LoadTable(string tablename, Type type)
    {
        if (mTableMap.ContainsKey(tablename) == true)
        {
            Debug.Log("Load table is error!!! Had a file! Name=" + tablename);
            return(false);
        }

        TextAsset o = ResourcesManager.GetInstance().LoadLocalAsset("Tables/" + tablename) as TextAsset;

        if (o == null)
        {
            Debug.Log("Load table is error!!!Read File is error! File=" + tablename);
            return(false);
        }

        GameTable tab = GameTable.Clone(type);

        tab.name = o.name;

        ReadTable(o.text, ref tab);

        mTableMap.Add(tab.name, tab);
        return(true);
    }