コード例 #1
0
    public static LanguageSettingConfig LoadEditorConfig()
    {
        if (ResourceManager.GetResourceIsExist(LanguageManager.c_configFileName))
        {
            LanguageSettingConfig config;

            string json = AssetsPoolManager.ReadTextFile(LanguageManager.c_configFileName);

            if (!string.IsNullOrEmpty(json))
            {
                config = JsonUtils.FromJson <LanguageSettingConfig>(json);
            }
            else
            {
                config = null;

                //config.defaultLanguage = SystemLanguage.ChineseSimplified;
                //config.gameExistLanguages.Add(SystemLanguage.ChineseSimplified);
            }
            return(config);
        }
        else
        {
            return(null);
        }
    }
コード例 #2
0
    public static Dictionary <string, SingleField> GetData(string ConfigName)
    {
        if (s_configCache.ContainsKey(ConfigName))
        {
            return(s_configCache[ConfigName]);
        }

        string dataJson = "";

        if (!Application.isPlaying)
        {
            dataJson = ResourceIOTool.ReadStringByResource(
                PathTool.GetRelativelyPath(c_directoryName,
                                           ConfigName,
                                           c_expandName));
        }
        else
        {
            dataJson = AssetsPoolManager.ReadTextFile(ConfigName);
        }


        if (dataJson == "")
        {
            throw new Exception("ConfigManager GetData not find " + ConfigName);
        }
        else
        {
            Dictionary <string, SingleField> config = JsonTool.Json2Dictionary <SingleField>(dataJson);

            s_configCache.Add(ConfigName, config);
            return(config);
        }
    }
コード例 #3
0
    public override void Init()
    {
        m_protocolInfo = ReadProtocolInfo(AssetsPoolManager.ReadTextFile(c_ProtocolFileName));
        ReadMethodNameInfo(
            out m_methodNameInfo,
            out m_methodIndexInfo,
            AssetsPoolManager.ReadTextFile(c_methodNameInfoFileName));

        m_messageBuffer = new byte[1024 * 1024 * 8];

        m_head  = 0;
        m_total = 0;

        base.Init();
    }
コード例 #4
0
    private void InitData()
    {
        if (subStringList == null)
        {
            return;
        }
        subStringsData = new Dictionary <string, string[]>();
        for (int i = 0; i < subStringList.Count; i++)
        {
            if (subStringList[i] == null)
            {
                continue;
            }
            string[] subString = AssetsPoolManager.ReadTextFile(subStringList[i]).Split(splitChar);

            subStringsData.Add(subStringList[i], subString);
        }
    }
コード例 #5
0
    public static Dictionary <string, Dictionary <SystemLanguage, TextStyleData> > LoadData()
    {
        string text = "";

        if (Application.isPlaying)
        {
            text = AssetsPoolManager.ReadTextFile(FileName);
        }
        else
        {
            text = FileUtils.LoadTextFileByPath(FilePathDir + FileName + ".txt");
        }
        if (!string.IsNullOrEmpty(text))
        {
            return(JsonUtils.FromJson <Dictionary <string, Dictionary <SystemLanguage, TextStyleData> > >(text));
        }
        else
        {
            return(new Dictionary <string, Dictionary <SystemLanguage, TextStyleData> >());
        }
    }
コード例 #6
0
    public static DataTable GetData(string DataName)
    {
        try
        {
            //编辑器下不处理缓存
            if (s_dataCache.ContainsKey(DataName))
            {
                return(s_dataCache[DataName]);
            }

            DataTable data     = null;
            string    dataJson = "";

            if (Application.isPlaying)
            {
                dataJson = AssetsPoolManager.ReadTextFile(DataName);
            }
            else
            {
                dataJson = ResourceIOTool.ReadStringByResource(
                    PathTool.GetRelativelyPath(c_directoryName,
                                               DataName,
                                               c_expandName));
            }

            if (dataJson == "")
            {
                throw new Exception("Dont Find ->" + DataName + "<-");
            }
            data             = DataTable.Analysis(dataJson);
            data.m_tableName = DataName;

            s_dataCache.Add(DataName, data);
            return(data);
        }
        catch (Exception e)
        {
            throw new Exception("GetData Exception ->" + DataName + "<- : " + e.ToString());
        }
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        transform.GetComponent <InputField>().onValueChanged.AddListener(OnValueChanged);

        if (String.IsNullOrEmpty(textName))
        {
            Debug.LogError("MaskWord textName error = " + textName);
            //无屏蔽字库
            return;
        }
        SentiWords = AssetsPoolManager.ReadTextFile(textName).Split(splitChar);
        for (int i = 0; i < SentiWords.Length; i++)
        {
            if (SentiWords[i].Contains("\n"))
            {
                SentiWords[i] = SentiWords[i].Replace("\r", "");

                SentiWords[i] = SentiWords[i].Replace("\n", "");
            }
        }
        inputField = transform.GetComponent <InputField>();
    }
コード例 #8
0
    public static void DoLuaFile(string fileName)
    {
        string content = AssetsPoolManager.ReadTextFile(fileName);

        s_state.DoString(content, fileName);
    }