Ejemplo n.º 1
0
    //Native File Picker Save (for Android and iOS)
    public void NativeFileBrowserSavePalette()
    {
        if (pc.currentPalette == null)
        {
            Debug.LogWarning("No Palette selected! Cannot save."); return;
        }
        //Create temporary file path to create a CSV:
        string filePath = Path.Combine(Application.temporaryCachePath, pc.currentPalette.title + ".csv");

        SaveCSVPalette(pc.currentPalette, filePath);

        // Export the selected file to the target directory
        NativeFilePicker.Permission permission = NativeFilePicker.ExportFile(filePath, (success) => Debug.Log("File exported: " + success));
        Debug.Log("Permission result: " + permission);
    }
Ejemplo n.º 2
0
    // public static void Print(string name)
    // {
    //     string savePath = Application.persistentDataPath;

    //     string full_path = savePath + "/" + name;


    //     Debug.Log(string.Format("<color=yellow>Saving file path is {0}</color>", full_path));
    // }

    public static void SaveHTML_IOS_Android(string html_as_string, string _fileName)
    {
        string fileName = "Агриферт_" + _fileName;

        // string day = System.DateTime.Now.ToString("dd/MM/yy");
        System.DateTime dateTime = System.DateTime.Now;

        fileName += "_" + dateTime.Day.ToString() + "_" + dateTime.Month.ToString() + "_" + dateTime.Year.ToString() + ".html";

        //fileName += "_" + day + ".html";
        //fileName += "_" + day + ".html";

        string filePath = Path.Combine(Application.temporaryCachePath, fileName);

        File.WriteAllText(filePath, html_as_string);

        NativeFilePicker.Permission permission = NativeFilePicker.ExportFile(filePath, (success) => Debug.Log("File exported: " + success));


        Debug.Log("Permission result: " + permission);
    }