コード例 #1
0
    void Init()
    {
        if (LogConsole.Instance.IsFileInUse(currentFilePath))
        {
            content = "<color=#" + LogConsole.ColorToHex(Color.red) + ">" + "文件正在被写入,读取失败" + "</color>";
        }
        else
        {
            content = System.IO.File.ReadAllText(currentFilePath, Encoding.UTF8);
        }

        maxPage = Mathf.FloorToInt(content.Length / maxNum);

        if (content.Length - maxPage * maxNum > 0)
        {
            maxPage++;
        }

        currentContent = RefreshPage();
    }