Example #1
0
        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();
    }
Example #4
0
    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;
    }
Example #6
0
        /// <summary>
        /// 表示開始
        /// </summary>
        public static void Start(object key)
        {
            Flags[key] = true;
#if UNITY_IPHONE || UNITY_ANDROID
            Handheld.SetActivityIndicatorStyle(Style);
            Handheld.StartActivityIndicator();
#endif
        }
Example #7
0
    void Awake()
    {
#if UNITY_IOS
        Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.WhiteLarge);
        WorkspaceEventManager.instance.onSavePictureClick += onSavePictureClickListener;
#endif
        initControllers();
    }
Example #8
0
    // 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
    }
Example #10
0
    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"));
    }
Example #11
0
 // ***************************************************************
 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);
 }
Example #12
0
        IEnumerator StartActivityIndicator()
        {
#if UNITY_IPHONE
            Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray);
#endif
#if UNITY_ANDROID
            Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge);
#endif
            Handheld.StartActivityIndicator();
            yield return(null);
        }
Example #13
0
    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...");
    }
Example #14
0
    void loadLevel3()
    {
        Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.InversedLarge);

        Handheld.StartActivityIndicator();
        //startDialog();
        Application.LoadLevel(3);
        //MainUI.SetActive(false);
        // loadingIndicator.SetActive(true);
        //progressBar.SetActive(true);
    }
Example #15
0
    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));
    }
Example #16
0
        void Awake()
        {
            if (IsDeviceIndicator())
            {
#if UNITY_IPHONE
                Handheld.SetActivityIndicatorStyle(iOSActivityIndicatorStyle.Gray);
#elif UNITY_ANDROID
                Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small);
#endif
                icon.SetActive(false);
            }
        }
Example #17
0
        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
        }
Example #18
0
    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();
    }
Example #19
0
        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);
        }
Example #20
0
    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);
    }
Example #22
0
        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
        }
Example #24
0
    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
    }
Example #25
0
    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);
        }
    }
Example #26
0
    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
    }
Example #27
0
 // 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
 }
Example #28
0
    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;
    }
Example #30
0
    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);
    }