void CopyIconSplash(CenterItem centerItem) { var dict = new DirectoryInfo("CenterProj/" + centerItem.pathName); var settingPath = "Assets/Game/PlayerSettings"; var filePath = dict.FullName + "/icon.png"; if (File.Exists(filePath)) { File.Copy(filePath, settingPath + "/icon.png", true); } filePath = dict.FullName + "/splash.jpg"; if (File.Exists(filePath)) { File.Copy(filePath, settingPath + "/splash.jpg", true); } }
// Use this for initialization void Start() { timerController = GetComponent <SurvivalModeTimerController>(); soundController = GetComponent <SoundController>(); centerItem = GetComponentInChildren <CenterItem>(); clickableObjects = GetComponentsInChildren <SurvivalModeClickableItem>(); gameOverMenu = GetComponentInChildren <GameOverMenu>(); soundTrackController = GetComponentInChildren <SoundTrackController>(); survivalScoreSavingController = GetComponent <SurvivalScoreSavingController>(); //highscore = PlayerPrefs.GetInt("HighScore"); soundTrackController.startSoundtrack(); }
void CopyCenterFile(CenterItem centerItem) { var allFileList = new List <string>(); var dict = new DirectoryInfo("CenterProj/" + centerItem.pathName); for (int k = 0; k < centerItem.fileList.Length; k++) { var path = dict.FullName + "/" + centerItem.fileList[k]; if (Directory.Exists(path)) { var kdict = new DirectoryInfo(dict.FullName + "/" + centerItem.fileList[k]); for (int i = 0; i < kdict.GetFiles().Length; i++) { if (kdict.GetFiles()[i].Name != ".DS_Store") { allFileList.Add(kdict.GetFiles()[i].FullName); } } for (int i = 0; i < kdict.GetDirectories().Length; i++) { var dict2 = kdict.GetDirectories()[i]; for (int j = 0; j < dict2.GetFiles().Length; j++) { if (dict2.GetFiles()[j].Name != ".DS_Store") { allFileList.Add(dict2.GetFiles()[j].FullName); } } } } else { allFileList.Add(path); } } foreach (string str in allFileList) { FileInfo f = new FileInfo(str); var pluginDir = new DirectoryInfo("Assets/Plugins/Android/"); var centerProjPath = f.DirectoryName.Replace("\\", "/"); var split = centerProjPath.Split(new string[] { "CenterProj/" + centerItem.pathName + "/" }, System.StringSplitOptions.None); if (split.Length > 1) { var dest = split[1]; if (dest == "bin") { File.Copy(str, pluginDir.FullName + f.Name); } else { var destsub = pluginDir.FullName + dest; if (!Directory.Exists(destsub)) { Directory.CreateDirectory(destsub); } File.Copy(str, destsub + "/" + f.Name); } } else { File.Copy(str, pluginDir.FullName + f.Name); } } }