def SaveCommonScript(self): listname = {"AppBase", "Common"} for name in listname: src = mainResource.GetRootUnityAssets()+"/Script/"+name dst = mainResource.GetDirProductCommon()+"/ProjectUnity/Assets/Script/"+name print(src) print(dst) FileUtil.CopyDir(src, dst)
def Run(self): gameType = mainResource.getGameType() gameName = mainResource.getGameName() configDirUnity = mainResource.GetRootUnityAssetsResource( ) + "/ConfigData/config" configAppType = mainConfig.GetConfigAppType(configDirUnity) configAppName = mainConfig.GetConfigAppName(configDirUnity) print("unity:" + configAppType + " " + configAppName) if gameType != configAppType or gameName != configAppName: print("check app type and name fail") sys.exit(0) dir1 = mainResource.GetRootUnityAssetsResource() + "/App" dir2 = mainResource.GetResourceDataRoot( ) + "/" + gameType + "/" + gameName + "/" + Source.Dir_Name_Resources + "/App" flag = os.path.exists(dir2) if flag: shutil.rmtree(dir2) shutil.copytree(dir1, dir2) # AppCommon dir1 = mainResource.GetRootUnityAssetsResource() + "/AppCommon" dir2 = mainResource.GetResourceDataRoot( ) + "/" + gameType + "/" + "AppCommon/" + Source.Dir_Name_Resources flag = os.path.exists(dir2) FileUtil.CopyDir(dir1, dir2) # ConfigData dir1 = mainResource.GetRootUnityAssetsResource() + "/ConfigData" dir2 = mainResource.GetResourceDataRoot( ) + "/" + gameType + "/" + gameName + "/ConfigData" flag = os.path.exists(dir2) FileUtil.CopyDir(dir1, dir2) print("save_resource sucess")
def Run(self): # resoucedata gameType = mainResource.getGameType() gameName = mainResource.getGameName() dir1 = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/"+Source.Dir_Name_Resources+"/App" dir2 = mainResource.GetRootUnityAssetsResource()+"/App" flag = os.path.exists(dir2) if flag: shutil.rmtree(dir2) print("copytree dir2 =",dir2) shutil.copytree(dir1,dir2) # AppCommon dir1 = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+"AppCommon/"+Source.Dir_Name_Resources dir2 = mainResource.GetRootUnityAssetsResource()+"/AppCommon" FileUtil.CopyDir(dir1,dir2) self.CopyResConfigData() # self.CopyPlugins() print ("copy_resource sucess")