//When Hit a language Button public void Caching_VoiceOver(String LanguagePressed, String Json) { Current_Language = LanguagePressed; Current_Json = Json; // first time if (counter == 0) { LanguageChoice(Json, LanguagePressed); counter++; } // later times within same session with different languages if user choose another language than language that already being downloaded check canvas will be shawn to ask either he want to continue language in progress or cancel and start the other one else if (counter > 0 && Lan_temp != LanguagePressed) { CheckCanvas.SetActive(true); interceptor.SetActive(true); } // later times within same session with same language if user choose language that already being download > No Need To shaw any Dialogues > else if (counter > 0 && Lan_temp == LanguagePressed) { return; } }
// when hit resume it simply hide check-canvas and let language in progress finish download public void OnResumeDownload() { CheckCanvas.SetActive(false); interceptor.SetActive(false); }
// when hit cancel button that appeared on Checkcanvas language in progress will be canceled and start download another language public void OnCancelDownload() { CheckCanvas.SetActive(false); interceptor.SetActive(false); LanguageChoice(Current_Json, Current_Language); }