Guest User

Untitled

a guest
Jan 20th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.IO;
  5. using UnityEngine.Assertions;
  6. using UnityEditor;
  7.  
  8. [InitializeOnLoad]
  9. class EditorStartup
  10. {
  11. static EditorStartup ()
  12. {
  13. CopyDBs ();
  14. }
  15.  
  16. static void CopyDBs()
  17. {
  18. string editorPath = Application.persistentDataPath + "/Editor" ; // HARDCODE
  19. // var debugString = string.Format ("EditorUtil.CopyDBs: editorPath={0}", editorPath);
  20. // Debug.Log (debugString);
  21.  
  22. FileUtil.DeleteFileOrDirectory (editorPath);
  23. Directory.CreateDirectory (editorPath);
  24. string rosettaName = "RosettaStone";
  25. string masterName = "MasterData";
  26. string dynamicName = "DynamicDB";
  27. string rosettaPath = Application.persistentDataPath + "/" + rosettaName + ".bytes";
  28. string masterPath = Application.persistentDataPath + "/" + masterName + ".bytes";
  29. string dynamicPath = Application.persistentDataPath + "/" + dynamicName + ".bytes";
  30.  
  31. Assert.IsTrue (File.Exists (rosettaPath));
  32. Assert.IsTrue (File.Exists (masterPath));
  33. Assert.IsTrue (File.Exists (dynamicPath));
  34. File.Copy (rosettaPath, editorPath + "/" + rosettaName + "_E.bytes");
  35. File.Copy (masterPath, editorPath + "/" + masterName + "_E.bytes");
  36. File.Copy (dynamicPath, editorPath + "/" + dynamicName + "_E.bytes");
  37. }
  38. }
Add Comment
Please, Sign In to add comment