Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- }
Add Comment
Please, Sign In to add comment