public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason) { // A product purchase attempt did not succeed. Check failureReason for more detail. Consider sharing // this reason with the user to guide their troubleshooting actions. Debug.Log(string.Format("OnPurchaseFailed: FAIL. Product: '{0}', PurchaseFailureReason: {1}", product.definition.storeSpecificId, failureReason)); Handheld.StopActivityIndicator(); }
public IEnumerator wwwRequest(string url, float timeLimit = downloadTimeLimit) { Handheld.StartActivityIndicator(); www = new WWW(url); if (GPSController.Instance.userLocationStable) { float downloadTime = 0; while (!www.isDone) { downloadTime += Time.deltaTime; if (downloadTime >= timeLimit) { break; } yield return(null); } Debug.Log("WWW transfer from " + url.Substring(8, 40) + ".. @: " + (www.progress * 100) + "% in " + downloadTime + "s / " + timeLimit + "s"); if (!www.isDone || !string.IsNullOrEmpty(www.error)) { Debug.LogError("Network error. Load not complete! TERMINATED AT:" + (int)www.progress * 100 + "%"); yield break; } Handheld.StopActivityIndicator(); yield return(www); } }
void BuyProductID(string productId) { Handheld.StartActivityIndicator(); // If Purchasing has been initialized ... if (IsInitialized()) { // ... look up the Product reference with the general product identifier and the Purchasing // system's products collection. Product product = m_StoreController.products.WithID(productId); // If the look up found a product for this device's store and that product is ready to be sold ... if (product != null && product.availableToPurchase) { Debug.Log(string.Format("Purchasing product asychronously: '{0}'", product.definition.id)); // ... buy the product. Expect a response either through ProcessPurchase or OnPurchaseFailed // asynchronously. m_StoreController.InitiatePurchase(product); } // Otherwise ... else { // ... report the product look-up failure situation Debug.Log("BuyProductID: FAIL. Not purchasing product, either is not found or is not available for purchase"); Handheld.StopActivityIndicator(); } } // Otherwise ... else { // ... report the fact Purchasing has not succeeded initializing yet. Consider waiting longer or // retrying initiailization. Debug.Log("BuyProductID FAIL. Not initialized."); Handheld.StopActivityIndicator(); } }
void endMovio() { #if PC #else Handheld.StopActivityIndicator(); #endif }
void OnLevelWasLoaded() { #if UNITY_IOS || UNITY_ANDROID Handheld.StopActivityIndicator(); #endif GameObject.Destroy(gameObject); }
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 Awake() { FilePath = pathSettings.RootPath + FilePath; if (File.Exists(FilePath)) { objImporter = gameObject.GetComponent <ObjectImporter>(); if (objImporter == null) { objImporter = gameObject.AddComponent <ObjectImporter>(); } objImporter.ImportingStart += () => { Handheld.StartActivityIndicator(); }; objImporter.ImportedModel += (baseModel, name) => { var model = baseModel.transform.GetChild(0); var center = model.GetComponent <MeshFilter>().mesh.bounds.center; model.transform.position = -center; loadingText.enabled = false; Handheld.StopActivityIndicator(); }; objImporter.ImportError += (err) => { Utils.ShowAndroidToastMessage(err); }; } else { Utils.ShowAndroidToastMessage("path: '" + FilePath + "' not exist"); } }
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // A consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); // TODO: The non-consumable item has been successfully purchased, grant this item to the player. SecurePlayerPrefs.SetInt("RemoveBannersAndPopUps", 1); } // Or ... a subscription product has been purchased by this user. else if (String.Equals(args.purchasedProduct.definition.id, kProductIDNonConsumable2, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); SecurePlayerPrefs.SetInt("DoubleStars", 1); } // Or ... an unknown product has been purchased by this user. Fill in additional products here.... else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating whether this product has completely been received, or if the application needs // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still // saving purchased products to the cloud, and when that save is delayed. Handheld.StopActivityIndicator(); return(PurchaseProcessingResult.Complete); }
private static void OnRedeemCodeReturnFailed(string e) { new Message { title = LocalizeUtils.Get("Redeem Failed"), content = LocalizeUtils.Get(e), }.Show(); Handheld.StopActivityIndicator(); }
void VideoReady(VideoPlayer vp) { Debug.Log("o pya j"); Handheld.StopActivityIndicator(); anim.SetTrigger("FadeIn"); video1GO.SetActive(true); player1.Play(); player1.loopPointReached += Video1Complete; }
internal void StopActivityIndicator() { if (IsTestType()) { return; } #if UNITY_ANDROID Handheld.StopActivityIndicator(); #endif }
async UniTask ILoading.OnHide(float defaultDuration) { #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS) Handheld.StopActivityIndicator(); #else await _canvasGroup .DOFade(0.0f, defaultDuration) .OnCompleteAsUniTask(); #endif }
/// <summary> /// 強制的に非表示 /// 全てのフラグはfalseになります。 /// </summary> public static void Stop() { // 全てにfalseを設定 foreach (var key in Flags.Keys) { Flags[key] = false; } #if UNITY_IPHONE || UNITY_ANDROID // 非表示 Handheld.StopActivityIndicator(); #endif }
void Start() { if (SceneManager.DEBUG_SCENES) { Debug.Log("Scene " + Scene() + " Start"); } SceneManager.Instance.HandleSceneAwake(this); PostStart(); SceneManager.Instance.finishedSwitching(); Handheld.StopActivityIndicator(); }
//撮影後コールバックされる関数 void DidImageWriteToAlbum(string errorDescription) { Handheld.StopActivityIndicator(); if (string.IsNullOrEmpty(errorDescription)) { OnCompleteCapture.Invoke(); } else { OnFailCapture.Invoke(); } }
public void CloseWebview() { if (webViewObject != null) { webViewObject.SetVisibility(false); Destroy(webViewObject.gameObject); } #if UNITY_IPHONE || UNITY_ANDROID Handheld.StopActivityIndicator(); #endif }
/// <summary> /// Sets the native loading. /// </summary> /// <param name="isLoading">If set to <c>true</c> is loading.</param> public static void SetNativeLoading(bool isLoading) { #if UNITY_IOS || UNITY_ANDROID if (isLoading) { Handheld.StartActivityIndicator(); } else { Handheld.StopActivityIndicator(); } #endif }
/// <summary> /// 非表示 /// </summary> public static void Stop(object key) { Flags[key] = false; #if UNITY_IPHONE || UNITY_ANDROID // いづれか一つでもtrueなら消さない if (Flags.Values.Any(item => item) == true) { return; } // 非表示 Handheld.StopActivityIndicator(); #endif }
// Restore purchases previously made by this customer. Some platforms automatically restore purchases, like Google. // Apple currently requires explicit purchase restoration for IAP, conditionally displaying a password prompt. public void RestorePurchases() { Handheld.StartActivityIndicator(); // If Purchasing has not yet been set up ... if (!IsInitialized()) { // ... report the situation and stop restoring. Consider either waiting longer, or retrying initialization. Debug.Log("RestorePurchases FAIL. Not initialized."); Handheld.StopActivityIndicator(); return; } // If we are running on an Apple device ... if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.OSXPlayer) { // ... begin restoring purchases Debug.Log("RestorePurchases started ..."); // Fetch the Apple store-specific subsystem. var apple = m_StoreExtensionProvider.GetExtension <IAppleExtensions>(); // Begin the asynchronous process of restoring purchases. Expect a confirmation response in // the Action<bool> below, and ProcessPurchase if there are previously purchased products to restore. apple.RestoreTransactions((result) => { // The first phase of restoration. If no more responses are received on ProcessPurchase then // no purchases are available to be restored. Debug.Log("RestorePurchases continuing: " + result + ". If no further messages, no purchases available to restore."); // MNPopup popup = new MNPopup ("Restore Complete", "All purchases restored"); // popup.AddAction ("Close", () => {Debug.Log("Ok action callback");}); // popup.AddDismissListener (() => {Debug.Log("dismiss listener");}); // popup.Show (); Handheld.StopActivityIndicator(); }); } // Otherwise ... else { // We are not running on an Apple device. No work is necessary to restore purchases. Debug.Log("RestorePurchases FAIL. Not supported on this platform. Current = " + Application.platform); // MNPopup popup = new MNPopup ("Restore Failed", "Please check your internet connection"); // popup.AddAction ("Close", () => {Debug.Log("Ok action callback");}); // popup.AddDismissListener (() => {Debug.Log("dismiss listener");}); // popup.Show (); } }
private void Update() { if (m_IsLoading) { lock (k_CurrentLoadingOperationLock) { // Hides the spinner when completed. if (m_CurrentLoadingOperation.isDone) { Hide(); Handheld.StopActivityIndicator(); } } } }
void ScanMedia(string filePath) { if (Application.platform != RuntimePlatform.Android) { return; } #if UNITY_ANDROID using (AndroidJavaClass jcUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) using (AndroidJavaObject joActivity = jcUnityPlayer.GetStatic <AndroidJavaObject>("currentActivity")) using (AndroidJavaObject joContext = joActivity.Call <AndroidJavaObject>("getApplicationContext")) using (AndroidJavaClass jcMediaScannerConnection = new AndroidJavaClass("android.media.MediaScannerConnection")) jcMediaScannerConnection.CallStatic("scanFile", joContext, new string[] { filePath }, new string[] { "image/png" }, null); Handheld.StopActivityIndicator(); #endif }
private IEnumerator GetHighScoresWWW() { string scoreURL = "http://71.229.150.150:1337/requestScores"; string heightURL = "http://71.229.150.150:1337/requestHeights"; WWW scoreRequest = new WWW(scoreURL); WWW heightRequest = new WWW(heightURL); Handheld.StartActivityIndicator(); yield return(new WaitUntil(() => scoreRequest.isDone && heightRequest.isDone)); Handheld.StopActivityIndicator(); if (string.IsNullOrEmpty(scoreRequest.error)) { if (!string.IsNullOrEmpty(scoreRequest.text)) { ParseScoreData(scoreRequest.text, ScoreEntry.ScoreType.HIGH_SCORE); UIManager uiManager = GameObject.FindObjectOfType <UIManager> (); if (uiManager != null) { uiManager.PopulateHighScores(); } } } else { Debug.Log(scoreRequest.error); } if (string.IsNullOrEmpty(heightRequest.error)) { if (!string.IsNullOrEmpty(heightRequest.text)) { ParseScoreData(heightRequest.text, ScoreEntry.ScoreType.MAX_HEIGHT); } } else { Debug.Log(heightRequest.error); } }
static void ScanMedia(string filePath) { if (Application.platform != RuntimePlatform.Android) { return; } using (AndroidJavaClass jcUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) using (AndroidJavaObject joActivity = jcUnityPlayer.GetStatic <AndroidJavaObject>("currentActivity")) using (AndroidJavaObject joContext = joActivity.Call <AndroidJavaObject>("getApplicationContext")) using (AndroidJavaClass jcMediaScannerConnection = new AndroidJavaClass("android.media.MediaScannerConnection")) using (AndroidJavaClass jcEnvironment = new AndroidJavaClass("android.os.Environment")) using (AndroidJavaObject joExDir = jcEnvironment.CallStatic <AndroidJavaObject>("getExternalStorageDirectory")) { jcMediaScannerConnection.CallStatic("scanFile", joContext, new string[] { filePath }, new string[] { "image/png" }, null); } Handheld.StopActivityIndicator(); }
public void Resume() { callCounts--; if (callCounts < 0) { callCounts = 0; } if (callCounts == 0) { IsDisplayed = false; try { Handheld.StopActivityIndicator(); } catch (Exception e) { Debug.Log("Device not HandHeld, "); e.ToString(); } gameObject.SetActive(false); } }
/// <summary> /// インデックス情報にファイル名を登録する /// これをしないとPC から内部ストレージを参照した時にファイルが見えない /// </summary> /// <param name="path"></param> /// <param name="mimeType"></param> public static void ScanFile(string path, string mimeType) { if (Application.platform != RuntimePlatform.Android) { return; } using (AndroidJavaClass jcUnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) using (AndroidJavaObject joActivity = jcUnityPlayer.GetStatic <AndroidJavaObject>("currentActivity")) using (AndroidJavaObject joContext = joActivity.Call <AndroidJavaObject>("getApplicationContext")) using (AndroidJavaClass jcMediaScannerConnection = new AndroidJavaClass("android.media.MediaScannerConnection")) //using (AndroidJavaClass jcEnvironment = new AndroidJavaClass("android.os.Environment")) //using (AndroidJavaObject joExDir = jcEnvironment.CallStatic<AndroidJavaObject>("getExternalStorageDirectory")) { Debug.Log("------scanFile:" + path + "--------"); var mimeTypes = (mimeType != null) ? new string[] { mimeType } : null; jcMediaScannerConnection.CallStatic("scanFile", joContext, new string[] { path }, mimeTypes, null); } Handheld.StopActivityIndicator(); }
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; }
public void OnFinishLoadInterstitialAd(object sender, NendAdInterstitialLoadEventArgs args) { Handheld.StopActivityIndicator(); NendAdInterstitialStatusCode statusCode = args.StatusCode; switch (statusCode) { case NendAdInterstitialStatusCode.SUCCESS: // Move to the next scene when Interstitial-AD load completed. Debug.Log(">> OnFinishLoadInterstitialAd: SUCCESS"); SceneManager.LoadScene("First"); break; default: // When failed to get of Interstitial-AD, try to reload. Debug.Log(">> OnFinishLoadInterstitialAd: FAILURE"); ReloadAd(); break; } }
IEnumerator Share() { // スクリーンショットをとる Application.CaptureScreenshot("image.png"); // インジケーター表示 #if UNITY_IPHONE Handheld.SetActivityIndicatorStyle(UnityEngine.iOS.ActivityIndicatorStyle.White); #elif UNITY_ANDROID Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small); #endif Handheld.StartActivityIndicator(); // スクリーンショットが保存されるまで待機 long filesize = 0; string filePath = Path.Combine(Application.persistentDataPath, "image.png"); while (filesize == 0) { yield return(null); //ファイルのサイズを取得 System.IO.FileInfo fi = new System.IO.FileInfo(filePath); if (fi != null) { filesize = fi.Length; } } // インジケーター非表示 Handheld.StopActivityIndicator(); // shareのテキスト内容 string tweet = "" + "100点を記録しました!!"; // 共有 SocialConnector.SocialConnector.Share(tweet, "", filePath); }
private IEnumerator TryToConnect() { connectionError.SetActive(false); Handheld.StartActivityIndicator(); WWW www = new WWW(url); while (!www.isDone) { yield return(null); } Handheld.StopActivityIndicator(); if (www.text.Length > 0) { PlayerPrefs.SetString("score", www.text); Application.LoadLevel(1); } else { connectionError.SetActive(true); } }
public void Hide() { switch (_indicatorType) { case IndicatorType.Default: #if !UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS || UNITY_PSM) Handheld.StopActivityIndicator(); #else _imgDefaultIndicator.enabled = false; #endif break; default: Debug.LogErrorFormat("{0} NotFound {1}", typeof(IndicatorType).Name, _indicatorType); break; } if (tween != null) { tween.Kill(); tween = null; } _imgMask.enabled = false; }