Skip to content

Instantly share code, notes, and snippets.

@arun02139
Created January 21, 2017 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun02139/facd8c1cdb18203ad2fd4b335e9428dd to your computer and use it in GitHub Desktop.
Save arun02139/facd8c1cdb18203ad2fd4b335e9428dd to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.Assertions;
using UnityEditor;
[InitializeOnLoad]
class EditorStartup
{
static EditorStartup ()
{
CopyDBs ();
}
static void CopyDBs()
{
string editorPath = Application.persistentDataPath + "/Editor" ; // HARDCODE
// var debugString = string.Format ("EditorUtil.CopyDBs: editorPath={0}", editorPath);
// Debug.Log (debugString);
FileUtil.DeleteFileOrDirectory (editorPath);
Directory.CreateDirectory (editorPath);
string rosettaName = "RosettaStone";
string masterName = "MasterData";
string dynamicName = "DynamicDB";
string rosettaPath = Application.persistentDataPath + "/" + rosettaName + ".bytes";
string masterPath = Application.persistentDataPath + "/" + masterName + ".bytes";
string dynamicPath = Application.persistentDataPath + "/" + dynamicName + ".bytes";
Assert.IsTrue (File.Exists (rosettaPath));
Assert.IsTrue (File.Exists (masterPath));
Assert.IsTrue (File.Exists (dynamicPath));
File.Copy (rosettaPath, editorPath + "/" + rosettaName + "_E.bytes");
File.Copy (masterPath, editorPath + "/" + masterName + "_E.bytes");
File.Copy (dynamicPath, editorPath + "/" + dynamicName + "_E.bytes");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment