Beispiel #1
0
    public static DcConf GetBdzConfModel(string pathName = "")
    {
        if (string.IsNullOrEmpty(pathName))
        {
            pathName = Application.streamingAssetsPath + "/Conf/DcConf.json";
        }
        string json = U_IO.ReadByFileToString(pathName);

        try
        {
            var    jsonData = JsonMapper.ToObject(json);
            DcConf model    = new DcConf
            {
                version     = jsonData["version"].ToString(),
                sqlUrl      = jsonData["sqlUrl"].ToString(),
                sqlPort     = Convert.ToInt32(jsonData["sqlPort"].ToString()),
                sqlUser     = jsonData["sqlUser"].ToString(),
                sqlPassword = jsonData["sqlPassword"].ToString(),
                sqlDb       = jsonData["sqlDb"].ToString(),
                equipTable  = jsonData["equipTable"].ToString()
            };
            return(model);
        }
        catch (Exception e)
        {
            Debug.LogError(e);
            throw;
        }
    }
Beispiel #2
0
 public static void BuildAllAssetBundle(string directory, bool inAssets = true)
 {
     U_IO.CheckAndSetDirectory(directory, inAssets);
     if (!inAssets)
     {
         BuildPipeline.BuildAssetBundles(directory, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
     }
     else
     {
         BuildPipeline.BuildAssetBundles("Assets/" + directory, BuildAssetBundleOptions.None, BuildTarget.StandaloneWindows64);
     }
 }
Beispiel #3
0
    public virtual void TxtReadInit()
    {
        if (!isShowText)
        {
            return;
        }
        List <List <string> > strListList;

        if (txt != null)
        {
            strListList = U_TextAssets.TxtToStrListList(txt, typeCount, U_TextAssets.En_ListSplitType.根据类别分, U_String.TextSplitString, U_String.En_RemoveLine.去掉空行);
        }
        else
        {
            strListList = U_TextAssets.TxtToStrListList(U_IO.ReadByFileToString(Application.streamingAssetsPath + @"\" + txtName), typeCount, U_TextAssets.En_ListSplitType.根据类别分);
        }
        names         = strListList[0];
        introductions = strListList[1];
    }