Exemplo n.º 1
0
    /// <summary>
    /// 取得所有檔案名稱
    /// </summary>
    public static string[] GetSaveDataNames()
    {
        string aSavePath = GetSaveFullPath();

        try
        {
            string[] aSaveFileNames = SFileIOModfied.GetJsonFileNameArray(aSavePath);

            Debug.Log("GetFinish.");
            return(aSaveFileNames);
        }
        catch (Exception e)
        {
            Debug.LogError("Get DataNames temp data error:\n" + e.Message);
            return(null);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 依照檔案名稱尋找並讀取檔案
    /// </summary>
    public static SDefineSet LoadData(string iFileName)
    {
        string aSavePath = GetSaveFullPath();

        try
        {
            string     aLoadedJson = SFileIOModfied.LoadFromJsonFile(aSavePath, iFileName);
            SDefineSet aResult     = JsonConvert.DeserializeObject <SDefineSet>(aLoadedJson);
            Debug.Log("LoadFinish.");
            return(aResult);
        }
        catch (Exception e)
        {
            Debug.LogError("Load temp data error:\n" + e.Message);
            return(new SDefineSet());
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 儲存檔案
    /// </summary>
    public static void SaveData(SDefineSet iSetData)
    {
        string aSavePath = GetSaveFullPath();

        try
        {
            string aJsonString = JsonConvert.SerializeObject(iSetData, Formatting.Indented);

            Debug.Log("TestSave cahge to Json string\n" + aJsonString);
            SFileIOModfied.SaveNewJsonFile(aSavePath, iSetData.SettingName, aJsonString);
            AssetDatabase.Refresh();
            EditorUtility.DisplayDialog("成功", "資料建置完畢", "確定");
        }
        catch (Exception e)
        {
            Debug.LogError("Save temp data error:\n" + e.Message);
        }
    }
    /// <summary>
    /// 儲存PBX設定檔
    /// </summary>
    private static void SavePBXData(string iProjectPath)
    {
        string   aPbxPath = string.Format("{0}/{1}", iProjectPath, "Unity-iPhone.xcodeproj/project.pbxproj");
        FileInfo aFI      = new FileInfo(aPbxPath);

        if (!aFI.Exists)
        {
            Debug.Log("File Not Found, Path :" + aPbxPath);
            return;
        }

        PBXProject aPBXProject = new PBXProject();

        aPBXProject.ReadFromFile(aPbxPath);

        string aPBXSavePath = string.Format("{0}/{1}", Application.dataPath, cSaveAssetsPath);

        SFileIOModfied.SaveNewTxtFile(aPBXSavePath, cSavePBXTxtName, aPBXProject.WriteToString());
    }
Exemplo n.º 5
0
 private static void SASXGetCustomUpdate()
 {
     SFileIOModfied.ReWriteSXGetCustomInfo();
 }
Exemplo n.º 6
0
 protected override void DoChangeXSetting()
 {
     AddTBDFrameWork("libz");
     SXWindow.LoadPBXData(mXCodeProjectPath);
     SFileIOModfied.AddPushNotificationEntitlements(mXCodeProjectPath);
 }