Created
January 21, 2017 04:30
-
-
Save arun02139/facd8c1cdb18203ad2fd4b335e9428dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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