internal SayNumberAction(string number, eVoice voice, eLanguage language) { properties = new SayNumberActionProperties(); properties.language = language.ToString(); properties.voice = voice.ToString(); properties.number = number; }
internal SayDigitsAction(string digits, eVoice voice, eLanguage language) { properties = new SayDigitsActionProperties(); properties.digits = digits; properties.language = language.ToString(); properties.voice = voice.ToString(); }
//處理AutoRun public static void HandleAutoRun(eLanguage lang, bool isBundle, bool isUpload, bool isCompare) { for (int i = 0; i < Setting.AutoActionItems.Count; i++) { switch (Setting.AutoActionItems[i].acion) { case eBuildAcion.BundleUncompress: if (!isBundle) { continue; } BundleBuilder.HandleBundle(string.Format(Setting.AutoActionItems[i].value, GetLangPath(lang)), Setting.BuildType, false, false); break; case eBuildAcion.BundleCompress: if (!isBundle) { continue; } BundleBuilder.HandleBundle(string.Format(Setting.AutoActionItems[i].value, GetLangPath(lang)), Setting.BuildType, true, false); break; case eBuildAcion.Zip: ZipBuilder.HandleZip(string.Format(Setting.AutoActionItems[i].value, GetLangPath(lang)), Setting.BuildType, false); break; case eBuildAcion.Move2Output: Extension.HandleOutputAssets(lang, false); break; case eBuildAcion.Move2Streaming: Extension.HandleStreamingAssets(lang, false); break; case eBuildAcion.BuildVersion: VersionBuilder.HandleVersion(lang.ToString(), false); break; case eBuildAcion.DownloadVersion: HTTP.HandleDownloadVersion(lang, false); break; case eBuildAcion.Upload: if (!isUpload) { continue; } if (!isCompare) { FTP.HandleUpload(string.Format("Assets/{0}/{1}", Setting.OutputAssetsFolder, GetLangPath(lang)), false); } else { FTP.HandleUploadEx(lang, false); } break; } } EditorUtility.DisplayDialog("AutoRun", "Auto Run Complete!", "OK"); }
internal SayAction(string text, eVoice voice, eLanguage language) { properties = new SayProperties(); properties.language = language.ToString(); properties.text = text; properties.voice = voice.ToString(); }
//處理最小包 public static void HandleStreamingAssets(eLanguage lang, bool isShow = true) { for (int i = 0; i < Setting.StreamingCount; i++) { string[] files = Directory.GetFiles(Application.dataPath + "/" + Setting.OutputAssetsFolder + "/" + GetLangPath(lang), Setting.StreamingItems[i].value, SearchOption.AllDirectories); for (int j = 0; j < files.Length; j++) { string path = files[j].Replace("\\", "/"); string name = Path.GetFileName(path); string extension = Path.GetExtension(path); if (extension == ".meta") { continue; } string sourcePath = Application.dataPath + "/" + Setting.OutputAssetsFolder + "/" + GetDataPath(Path.GetDirectoryName(path), Application.dataPath + "/" + Setting.OutputAssetsFolder + "/"); string destPath = Application.streamingAssetsPath + "/" + GetDataPath(Path.GetDirectoryName(path), Application.dataPath + "/" + Setting.OutputAssetsFolder + "/"); MoveFile(name, sourcePath, destPath); } } if (isShow) { EditorUtility.DisplayDialog("Move", "Move complete!", "OK"); } AssetDatabase.Refresh(); }
private static void Download(eLanguage lang, string path, string name) { using (WWW bundle = new WWW(path + name)) { //檢查下載錯誤訊息 if (bundle.error != null) { throw new System.Exception(bundle.error); } while (bundle.isDone == false) { if (bundle.error != null) { throw new System.Exception(bundle.error); } } //檢查是否下載完成 if (bundle.isDone == true) { byte[] xor = Tools.XOR(bundle.bytes, Setting.EncryptionKeyValue); string str = GetLocation(Setting.HTTP, Setting.User); string zPath = Application.dataPath + "/" + Setting.DownloadAssetsFolder + "/" + path.Replace(str, ""); Tools.Save(zPath, name, xor); } else { throw new System.Exception(bundle.error); } } }
/// <summary> /// Загрузка из файла настроек /// </summary> /// <returns></returns> public static void LoadSetting() { string sPulseX = LoadProperty("pulseX").Trim(); string sPulseY = LoadProperty("pulseY").Trim(); string sPulseZ = LoadProperty("pulseZ").Trim(); string sStartupConnect = LoadProperty("StartupConnect").Trim(); string sDeviceModel = LoadProperty("DeviceModel").Trim(); string sLanguage = LoadProperty("Language").Trim(); if (sPulseX != "") { Setting.PulseX = int.Parse(sPulseX); } if (sPulseY != "") { Setting.PulseY = int.Parse(sPulseY); } if (sPulseZ != "") { Setting.PulseZ = int.Parse(sPulseZ); } if (sStartupConnect != "") { StartupConnect = bool.Parse(sStartupConnect); } switch (sDeviceModel) { case "MK1": Setting.DeviceModel = DeviceModel.MK1; break; case "MK2": Setting.DeviceModel = DeviceModel.MK2; break; default: Setting.DeviceModel = DeviceModel.Emulator; break; } switch (sLanguage) { case "rus": Setting.language = eLanguage.rus; break; case "eng": Setting.language = eLanguage.eng; break; default: Setting.language = eLanguage.eng; break; } }
public string GetNameWithPostFix(eLanguage language) { if (string.IsNullOrWhiteSpace(PostFix)) { return(base.GetName(language)); } return(base.GetName(language) + " " + PostFix); }
// 유틸 : 언어설정 eLanguage GetLanguage() { m_eLanguage = (eLanguage)SHPlayerPrefs.GetInt("ApplicationInfo_Language", 0); if (eLanguage.None == m_eLanguage) { SetLanguage(SHHard.GetSystemLanguage()); } return(m_eLanguage); }
public static void GetSelectedLanguage() { Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Telldus"); if (key != null) { if (key.GetValue("Language") != null) { m_SelectedLanguage = (eLanguage)Enum.Parse(typeof(eLanguage), key.GetValue("Language").ToString()); } key.Close(); } }
public static void ChooseLanguage(eLanguage language) { switch (language) { case eLanguage.Chinese: Language = "Font-zh-CN"; break; case eLanguage.English: Language = "Font-en-US"; break; } UpdateLanguage(); }
public static void ChangeLanguage(eLanguage language) { m_SelectedLanguage = language; if (language == eLanguage.English) { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB"); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-GB");//en } else if (language == eLanguage.Swedish) { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("sv-SE");//sv System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("sv-SE"); } }
public static string GetTranslate(eLanguage _lang, string _value) { //_dialog_setting_ rus Настройки программы //_dialog_setting_ eng Setting application langString ss = ValueLangStrings.Find(x => x._NAME_ == _value); //TODO: сделать механизм по нормальному return(null); }
public static void SetLanguage(eLanguage language) { switch (language) { case eLanguage.Vi: HttpContext.Current.Session["SS_LANGUAGE"] = ResxManager.Vi.UICulture; break; case eLanguage.En: HttpContext.Current.Session["SS_LANGUAGE"] = ResxManager.En.UICulture; break; default: HttpContext.Current.Session["SS_LANGUAGE"] = ResxManager.Vi.UICulture; break; } }
//處理上傳資料 public static void HandleDownloadVersion(eLanguage lang, bool isShow = true) { string vPath = GetLocation(Setting.HTTP, Setting.User) + GetLangPath(lang, true) + "Versions/"; string zPath = Application.dataPath + "/" + Setting.DownloadAssetsFolder + "/" + GetLangPath(lang, true) + "Versions/"; string xPath = Application.dataPath + "/AutoLauncher/log/" + Setting.DownloadAssetsFolder + "/" + GetLangPath(lang, true) + "Versions/"; //檢查目錄是否存在 if (Directory.Exists(zPath) == true) { Directory.Delete(zPath, true); } //檢查目錄是否存在 if (Directory.Exists(xPath) == true) { Directory.Delete(xPath, true); } try { if (Setting.VersionItems == null || Setting.VersionItems.Count == 0) { Download(lang, vPath, "Main.res"); } else { for (int i = 0; i < Setting.VersionItems.Count; i++) { Download(lang, vPath, Setting.VersionItems[i].ver); } } } catch (System.Exception e) { Debug.LogWarning(e.Message + " " + "Version" + " Download Err!"); } if (isShow == true) { EditorUtility.DisplayDialog("Download", "Download all complete!", "OK"); } AssetDatabase.Refresh(); }
public static CompileProperties Create(ePlatform platform = ePlatform.Auto, eArchitecture arch = eArchitecture.Default, eCudafyCompileMode mode = eCudafyCompileMode.Default, string workingDir = null, bool debugInfo = false) { CompileProperties tp = new CompileProperties(); eLanguage language = GetLanguage(arch); if (language == eLanguage.Cuda) { string progFiles = Utility.ProgramFiles(); tp.CompilerPath = NvccExe.getCompilerPath(); tp.IncludeDirectoryPath = NvccExe.getIncludePath(); tp.PathEnvVarExtraEntries = new string[1] { NvccExe.getClExeDirectory() }; tp.Architecture = (arch == eArchitecture.Unknown) ? eArchitecture.Default : arch; bool binary = ((mode & eCudafyCompileMode.Binary) == eCudafyCompileMode.Binary); string tempFileName = "CUDAFYSOURCETEMP.tmp"; string cuFileName = tempFileName.Replace(".tmp", ".cu"); string outputFileName = tempFileName.Replace(".tmp", binary ? ".cubin" : ".ptx"); tp.InputFile = cuFileName; tp.OutputFile = outputFileName; if ((mode & eCudafyCompileMode.DynamicParallelism) == eCudafyCompileMode.DynamicParallelism) { tp.AdditionalInputArgs = "cudadevrt.lib cublas_device.lib -dlink"; } if (arch == eArchitecture.Emulator) { mode = eCudafyCompileMode.TranslateOnly; } } else { mode = eCudafyCompileMode.TranslateOnly; tp.Architecture = (arch == eArchitecture.Unknown) ? eArchitecture.OpenCL : arch; } tp.WorkingDirectory = Directory.Exists(workingDir) ? workingDir : Environment.CurrentDirectory; tp.Platform = platform; tp.CompileMode = mode; tp.GenerateDebugInfo = debugInfo; return(tp); }
//處理最小包 public static void HandleOutputAssets(eLanguage lang, bool isShow = true) { for (int i = 0; i < Setting.OutputCount; i++) { string[] files = Directory.GetFiles(Application.dataPath + "/" + Setting.InputAssetsFolder + "/" + GetLangPath(lang), Setting.OutputItems[i].value, SearchOption.AllDirectories); for (int j = 0; j < files.Length; j++) { string path = files[j].Replace("\\", "/"); string name = Path.GetFileName(path); string extension = Path.GetExtension(path); if (extension == ".meta") { continue; } string sourcePath = Application.dataPath + "/" + Setting.InputAssetsFolder + "/" + GetDataPath(Path.GetDirectoryName(path), Application.dataPath + "/" + Setting.InputAssetsFolder + "/"); string destPath = Application.dataPath + "/" + Setting.OutputAssetsFolder + "/" + GetDataPath(Path.GetDirectoryName(path), Application.dataPath + "/" + Setting.InputAssetsFolder + "/"); if (extension != ".txt") { CopyFile(name, sourcePath, destPath); } else { //讀取資料 byte[] data = Tools.Load(GetDataPath(sourcePath, name), name); //加密存檔 Tools.Save(GetDataPath(destPath, name), name, data, Setting.EncryptionKeyValue); } } } if (isShow) { EditorUtility.DisplayDialog("Copy", "Copy complete!", "OK"); } AssetDatabase.Refresh(); }
//處理上傳資料 public static void HandleUploadEx(eLanguage lang, bool isShow = true) { string user = Setting.User; string pwd = Setting.PWD; string ip = Setting.IP; List <rRes> list1 = GetUploadList(lang); List <rRes> list2 = GetDownloadList(lang); for (int i = 0; i < list1.Count; i++) { string zPath = Application.dataPath + "/" + Setting.OutputAssetsFolder + "/" + list1[i].Path + list1[i].FileName; if (CheckNeedUpload(list1[i], list2) == false) { continue; } byte[] data = File.ReadAllBytes(zPath); zPath = GetLocation(ip) + GetDataPath(zPath, Application.dataPath + "/" + Setting.OutputAssetsFolder + "/"); try { Upload(user, pwd, zPath, data); } catch (System.Exception e) { Debug.LogError("Upload " + zPath + " Err! " + e.Message); return; } } HandleUpload(string.Format("Assets/{0}/{1}", Setting.OutputAssetsFolder, GetLangPath(lang, true) + "Versions/"), false); if (isShow) { EditorUtility.DisplayDialog("Upload", "Upload all complete!", "OK"); } }
//取得下載列表 private static List <rRes> GetDownloadList(eLanguage lang) { List <rRes> list = new List <rRes>(); byte[] data = null; rRes[] resData = null; string json = string.Empty; string path = Application.dataPath + "/" + Setting.DownloadAssetsFolder + "/" + GetLangPath(lang, true) + "Versions/"; if (Setting.VersionItems == null || Setting.VersionItems.Count == 0) { data = Tools.Load(path, "Main.res", Setting.EncryptionKeyValue); if (data != null) { json = System.Text.UTF8Encoding.UTF8.GetString(data); resData = Tools.DeserializeObject <rRes[]>(json); for (int i = 0; i < resData.Length; i++) { list.Add(resData[i]); } } } else { for (int i = 0; i < Setting.VersionItems.Count; i++) { data = Tools.Load(path, Setting.VersionItems[i].ver, Setting.EncryptionKeyValue); if (data != null) { json = System.Text.UTF8Encoding.UTF8.GetString(data); resData = Tools.DeserializeObject <rRes[]>(json); for (int j = 0; j < resData.Length; j++) { list.Add(resData[j]); } } } } return(list); }
public override void Deserialize(Packet p) { base.Deserialize(p); m_eLanguage = (eLanguage)p.ReadInt(); }
protected override void Reset() { m_eLanguage = eLanguage.English; m_strContents = string.Empty; }
public override void Deserialize(Packet p) { base.Deserialize(p); m_eLanguage = (eLanguage)p.ReadInt(); m_strContents = p.ReadString(); }
public static AddEnemy GetByName(string name, eLanguage lang) { return(allAdds.FirstOrDefault((e) => e.Value.GetName(lang) == name).Value); }
public void SayNumber(string number, eVoice voice, eLanguage language) { SayNumberAction sayNumberAction = new SayNumberAction(number, voice, language); actions.Add(sayNumberAction); }
public void SayDigits(string digits, eVoice voice, eLanguage language) { SayDigitsAction sayDigitsAction = new SayDigitsAction(digits, voice, language); actions.Add(sayDigitsAction); }
public string[,] GetRobotAlarmString(eLanguage lang = eLanguage.TW) { string[,] AlarmStr = { { "" } }; AlarmStr = m_Robot.GetAlarmCodes(lang); return(AlarmStr); }
public CUDALanguage(eLanguage language) { _language = language; InitializeCommon(); if (language == eLanguage.Cuda) InitializeCUDA(); else if (language == eLanguage.OpenCL) InitializeOpenCL(); }
public bool SaveNotice(eLanguage eLang, string contents) { return(true); }
private void InitializeGPUs() { eGPUType[] gpuTypes = new eGPUType[] { eGPUType.Cuda, eGPUType.OpenCL, eGPUType.Emulator }; eLanguage[] languages = new eLanguage[] { eLanguage.Cuda, eLanguage.OpenCL }; foreach (eGPUType gpuType in gpuTypes) { try { int numberOfAvailableDevices = CudafyHost.GetDeviceCount(gpuType); for (int deviceNumber = 0; deviceNumber < numberOfAvailableDevices; deviceNumber++) { GPGPU gpgpu = CudafyHost.GetDevice(gpuType, deviceNumber); GPGPUProperties gpgpuProperties = gpgpu.GetDeviceProperties(true); CudafyModes.Target = gpuType; foreach (eLanguage language in languages) { string cudaRandomFilename = Path.GetRandomFileName(); try { CudafyTranslator.Language = language; CompileProperties compileProperties = CompilerHelper.Create(ePlatform.Auto, eArchitecture.Unknown, eCudafyCompileMode.Default, CudafyTranslator.WorkingDirectory, CudafyTranslator.GenerateDebug); // Use a random filename to prevent conflict on default temp file when multithreading (unit tests) compileProperties.InputFile = cudaRandomFilename; // If this line fails with NCrunch/Unit tests, there probably is a new version of Cudafy.NET // and it needs to be registered in the GAC like this: gacutil -i Cudafy.NET.dll CudafyModule cudafyModule = CudafyTranslator.Cudafy(compileProperties, typeof(Primitives)); if (!gpgpu.IsModuleLoaded(cudafyModule.Name)) { gpgpu.LoadModule(cudafyModule); } gpgpu.EnableMultithreading(); string gpuName = gpgpuProperties.Name.Trim() + " - " + gpuType.ToString() + " - " + language.ToString(); ////this.gpgpus.Add(gpuName, gpgpu); ////this.gpgpuProperties.Add(gpuName, gpgpuProperties); ////this.gpuTypes.Add(gpuName, gpuType); } catch (CudafyCompileException) { // Language not supported } finally { File.Delete(cudaRandomFilename); // ncrunch: no coverage start } } } } catch (DllNotFoundException) { } catch (InvalidOperationException) { // Language not supported } catch (Cloo.ComputeException) { // Language not supported } // ncrunch: no coverage end } }
public SourceCodeFile(string source, eLanguage language, eArchitecture arch) : this() { Source = source; Language = language; Architecture = arch; }
public string[,] GetRobotWarnString(eLanguage lang = eLanguage.TW) { string[,] WarnStr = { { "" } }; WarnStr = m_Robot.GetWarnCodes(lang); return(WarnStr); }
protected override void Reset() { m_eLanguage = eLanguage.English; }
public void Say(string text, eVoice voice, eLanguage language) { SayAction sayAction = new SayAction(text, voice, language); actions.Add(sayAction); }
public Generator(Options Options) { Output = new DirectoryInfo(Options.Output); Language = Enum.Parse <eLanguage>(Options.Language); }
public string GetNotice(eLanguage eLang) { return(string.Empty); }
// Use this for initialization public void Load (ArrayList loadParameters) { // Reproducimos la musica de esta pantalla App.thisApp.controller.audio.playMusic (eMusic.Game5_Language); // Asignamos los eventos de los botones Button buttonHome = this.transform.FindChild("PanelHome/ButtonHome").GetComponent<Button>(); buttonHome.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenHome); App.thisApp.view.showScreen(eScreen.Home); }); Button buttonTribe = this.transform.FindChild("PanelHome/ButtonTribe").GetComponent<Button>(); buttonTribe.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenHome); App.thisApp.view.showScreen(eScreen.Parents); }); Button button1CreateStory = this.transform.FindChild("PanelMinigames/Button1CreateStory").GetComponent<Button>(); button1CreateStory.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame); App.thisApp.view.showScreen(eScreen.S1_CreateStory); }); Button button2PuzzleMolas = this.transform.FindChild("PanelMinigames/Button2PuzzleMolas").GetComponent<Button>(); button2PuzzleMolas.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame); App.thisApp.view.showScreen(eScreen.S2_PuzzleMolas); }); Button button3Iconography = this.transform.FindChild("PanelMinigames/Button3Iconography").GetComponent<Button>(); button3Iconography.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame); App.thisApp.view.showScreen(eScreen.S3_Iconography); }); Button button4HandicraftsAR = this.transform.FindChild("PanelMinigames/Button4HandicraftsAR").GetComponent<Button>(); button4HandicraftsAR.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame); App.thisApp.view.showScreen(eScreen.S4_HandicraftsAR); }); // Button button5Language = this.transform.FindChild("PanelMinigames/Button5Language").GetComponent<Button>(); // button5Language.onClick.AddListener( () => { // App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGame); // App.thisApp.view.showScreen(eScreen.S5_Language); // }); // Select Language Button buttonSelectLanguage1 = this.transform.FindChild("PanelSelectLanguage/PanelLanguage1").GetComponent<Button>(); buttonSelectLanguage1.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGallery); // Activamos el panel de preguntas this.transform.FindChild("PanelSelectLanguage").gameObject.SetActive(false); this.transform.FindChild("PanelQuestions").gameObject.SetActive(true); // Guardamos el lenguage seleccionado selectedLanguage = eLanguage.Cubeo; // Cargamos la primera pregunta loadRandomQuestion(); }); Button buttonSelectLanguage2 = this.transform.FindChild("PanelSelectLanguage/PanelLanguage2").GetComponent<Button>(); buttonSelectLanguage2.onClick.AddListener( () => { App.thisApp.controller.audio.playFX(eAudioFX.ButtonOpenGallery); // Activamos el panel de preguntas this.transform.FindChild("PanelSelectLanguage").gameObject.SetActive(false); this.transform.FindChild("PanelQuestions").gameObject.SetActive(true); // Guardamos el lenguage seleccionado selectedLanguage = eLanguage.Wounaan; // Cargamos la primera pregunta loadRandomQuestion(); }); // Questions Button buttonSound = this.transform.FindChild("PanelQuestions/ButtonSound").GetComponent<Button>(); buttonSound.onClick.AddListener( () => { // Reproducimos el audio de la palabra a descubrir App.thisApp.controller.audio.playFX(answerAudio); }); Button buttonOption1 = this.transform.FindChild("PanelQuestions/PanelOption1").GetComponent<Button>(); buttonOption1.onClick.AddListener( () => { // Ejecutamos las operaciones adecuadas optionSelected(1); }); Button buttonOption2 = this.transform.FindChild("PanelQuestions/PanelOption2").GetComponent<Button>(); buttonOption2.onClick.AddListener( () => { // Ejecutamos las operaciones adecuadas optionSelected(2); }); Button buttonOption3 = this.transform.FindChild("PanelQuestions/PanelOption3").GetComponent<Button>(); buttonOption3.onClick.AddListener( () => { // Ejecutamos las operaciones adecuadas optionSelected(3); }); Button buttonOption4 = this.transform.FindChild("PanelQuestions/PanelOption4").GetComponent<Button>(); buttonOption4.onClick.AddListener( () => { // Ejecutamos las operaciones adecuadas optionSelected(4); }); // Activamos el panel de seleccion de idioma this.transform.FindChild("PanelSelectLanguage").gameObject.SetActive(true); this.transform.FindChild("PanelQuestions").gameObject.SetActive(false); }