public string level = ""; // scene name to load // Use this for initialization void Start() { UnityEngine.Object.DontDestroyOnLoad(gameObject); // retain this object through a level load Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); Handheld.StartActivityIndicator(); StartCoroutine(WaitAndLoad()); }
IEnumerator LoadSceneFromFCM() { #if UNITY_ANDROID AndroidJavaClass UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject curActivity = UnityPlayer.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaObject curIntent = curActivity.Call <AndroidJavaObject>("getIntent"); string sceneToLoad = curIntent.Call <string>("getStringExtra", "sceneToOpen"); ChallengeManager.CurrentChallengeId = curIntent.Call <string>("getStringExtra", "challengeId"); Scene curScene = SceneManager.GetActiveScene(); if (!string.IsNullOrEmpty(sceneToLoad) && sceneToLoad != curScene.name) { // If the current scene is different than the intended scene to load, // load the intended scene. This is to avoid reloading an already acive // scene. Debug.Log("Loading Scene: " + sceneToLoad); Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); Handheld.StartActivityIndicator(); yield return(new WaitForSeconds(0f)); Debug.LogWarning(sceneToLoad); SceneManager.LoadScene(sceneToLoad); } #else yield return(null); #endif }
IEnumerator SendAnswer(string url) { Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); Handheld.StartActivityIndicator(); var encoding = new System.Text.UTF8Encoding(); var header = new Dictionary <string, string>(); header.Add("Content-Type", "application/json"); var jsonString = JsonConvert.SerializeObject(activeQuestion); WWW request = new WWW(url, encoding.GetBytes(jsonString), header); while (!request.isDone) { yield return(null); } UpdateScoreBoard(request.text); HighlightScoreboard(); AnswerField.image.color = Color.green; Invoke("FixInputColor", 0.5f); Number1.text = "00"; Number2.text = "00"; ToggleButtons(); Handheld.StopActivityIndicator(); }
private void SwitchSceneHelper(EScene newScene, bool allowSameScene) { if (!allowSameScene && newScene == currentScene_) { Debug.LogWarning("Request to switch to same scene " + newScene); } else { if (isSwitching_) { Debug.LogWarning("SwitchSceneHelper rejecting request to switch from " + currentScene_ + " to " + newScene + " because it's already switching"); } else { if (DEBUG_SCENES) { Debug.Log("SwitchSceneHelper: from " + currentScene_ + " to " + newScene); } isSwitching_ = true; #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.WhiteLarge); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif Handheld.StartActivityIndicator(); StartCoroutine(SwitchSceneCR(sceneNames_[newScene])); } } }
public void Show(IndicatorType indicatorType) { _indicatorType = indicatorType; switch (indicatorType) { case IndicatorType.Default: #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS || UNITY_PSM) #if UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #elif UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.WhiteLarge); #endif Handheld.StartActivityIndicator(); #else _imgDefaultIndicator.enabled = true; tween = DOTween.Sequence() .Append(_imgDefaultIndicator.transform .DOLocalRotate(new Vector3(0.0f, 0.0f, -180.0f), 0.5f) .SetEase(Ease.InSine)) .Append(_imgDefaultIndicator.transform .DOLocalRotate(new Vector3(0.0f, 0.0f, -360.0f), 0.5f) .SetEase(Ease.OutSine)) .SetLoops(-1, LoopType.Restart) .Play(); #endif break; default: Debug.LogErrorFormat("{0} NotFound {1}", typeof(IndicatorType).Name, indicatorType); break; } _imgMask.enabled = true; }
/// <summary> /// 表示開始 /// </summary> public static void Start(object key) { Flags[key] = true; #if UNITY_IPHONE || UNITY_ANDROID Handheld.SetActivityIndicatorStyle(Style); Handheld.StartActivityIndicator(); #endif }
void Awake() { #if UNITY_IOS Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.WhiteLarge); WorkspaceEventManager.instance.onSavePictureClick += onSavePictureClickListener; #endif initControllers(); }
// Use this for initialization IEnumerator Start() { Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); // this is for chaining coroutines. Start will return after TryToConnect is done. // could also make Start not a coroutine. yield return(StartCoroutine(TryToConnect())); }
//================================================================================= //初期化 //================================================================================= private void Awake() { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(_iosStyle); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(_androidStyle); #endif }
IEnumerator Logout() { // set the indicator to use Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); Handheld.StartActivityIndicator(); Debug.Log("Logout was pressed"); // keep spinning until coroutine finishes yield return(StartCoroutine("CheckForSuccessfulLogout")); }
// *************************************************************** private void playLongVideo(string id) { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif Handheld.StartActivityIndicator(); Handheld.PlayFullScreenMovie(YoutubeVideo.Instance.RequestVideo(id, 360), Color.black, FullScreenMovieControlMode.Full); }
IEnumerator StartActivityIndicator() { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray); #endif #if UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge); #endif Handheld.StartActivityIndicator(); yield return(null); }
static public void ShowIndicator() { #if UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.WhiteLarge); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif Handheld.StartActivityIndicator(); // MNP.ShowPreloader("HeroCry", "Loading..."); }
void loadLevel3() { Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge); Handheld.StartActivityIndicator(); //startDialog(); Application.LoadLevel(3); //MainUI.SetActive(false); // loadingIndicator.SetActive(true); //progressBar.SetActive(true); }
IEnumerator Load() { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif Handheld.StartActivityIndicator(); yield return(new WaitForSeconds(0)); }
void Awake() { if (IsDeviceIndicator()) { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif icon.SetActive(false); } }
public static void SetActivityIndicatorStyle() { #if UNITY_IPHONE #if UNITY_4_6_OR_EARLIER Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray); #else Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); #endif #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif }
IEnumerator Load() { yield return(new WaitForSeconds(temps)); SceneManager.LoadScene(Escena); #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif Handheld.StartActivityIndicator(); }
IEnumerator StartActivityIndicator() { #if UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); #endif #if UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge); #endif #if UNITY_IOS || UNITY_ANDROID Handheld.StartActivityIndicator(); #endif yield return(null); }
IEnumerator Load(String nameLevel) { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif Handheld.StartActivityIndicator(); yield return(new WaitForSeconds(0)); SceneManager.LoadScene(nameLevel); }
private IEnumerator LoadSceneCoroutine(string scene) { yield return(new WaitForEndOfFrame()); #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #elif UNITY_TIZEN Handheld.SetActivityIndicatorStyle(TizenActivityIndicatorStyle.Small); #endif Handheld.StartActivityIndicator(); SceneManager.LoadScene(scene); }
public string level = ""; // scene name to load // Use this for initialization void Start() { UnityEngine.Object.DontDestroyOnLoad(gameObject); // retain this object through a level load #if UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); #endif #if UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge); #endif #if UNITY_IOS || UNITY_ANDROID Handheld.StartActivityIndicator(); #endif StartCoroutine(WaitAndLoad()); }
async UniTask ILoading.OnShow(float defaultDuration) { #if !UNITY_EDITOR && UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); Handheld.StartActivityIndicator(); #elif !UNITY_EDITOR && UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.White); Handheld.StartActivityIndicator(); #else await _canvasGroup .DOFade(1.0f, defaultDuration) .OnCompleteAsUniTask(); #endif }
internal void SetActivityIndicatorStyle() { if (IsTestType()) { return; } #if UNITY_STANDALONE_WIN || UNITY_EDITOR return; #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedSmall); #elif UNITY_IOS Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); #endif }
void Start() { // Set loading indicator styles #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.WhiteLarge); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif // Authenticate to API if (!ApiManager.Instance.Authenticated) { Debug.Log("Authenticate to API"); ApiManager.Instance.Authenticate(ClientAuthenticated); } }
public static void ShowActivityIndicator() { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOS.ActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif Handheld.StartActivityIndicator(); #if UNITY_ANDROID // This must be called after Handheld.StartActivityIndicator() because that // method instantiates the ProgressBar widget whose layout params we are modifying. UnityActivityIndicator.MoveToCenterOfScreen(); #endif }
// Show device loading indicator public void ShowLoadingIndicator() { #if UNITY_IPHONE if (Global.isTablet) { Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.WhiteLarge); } else { Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.White); } #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); #endif #if UNITY_IPHONE || UNITY_ANDROID Handheld.StartActivityIndicator(); #endif }
public void Execute() { #if !UNITY_EDITOR PHAuthorizationStatus phstatus = (PHAuthorizationStatus)Enum.ToObject( typeof(PHAuthorizationStatus), UnityiOS.HasCameraRollPermission()); UnityiOS.PlaySystemShutterSound(); if (phstatus == PHAuthorizationStatus.Authorized) { Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.Gray); Handheld.StartActivityIndicator(); StartCoroutine(_CaptureScreenShot()); } else { OnFailCapture.Invoke(); } #endif }
IEnumerator GetQuestion(string url) { Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Large); Handheld.StartActivityIndicator(); WWW www = new WWW(url); while (!www.isDone) { yield return(null); } activeQuestion = JsonConvert.DeserializeObject <Question>(www.text); Number1.text = activeQuestion.Number1.ToString(); Number2.text = activeQuestion.Number2.ToString(); Handheld.StopActivityIndicator(); QuestionReceivedAt = DateTime.Now; OkButton.interactable = true; PassButton.interactable = true; }
IEnumerator Load() { #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif #if UNITY_IPHONE || UNITY_ANDROID Handheld.StartActivityIndicator(); #endif yield return(new WaitForSeconds(0)); #if UNITY_ANDROID yield return(AndroidHandleOBBDownload()); #endif Application.LoadLevel(1); }