Beispiel #1
0
        //initialize variables
        IEnumerator Start()
        {
            //on non-mobile devices hide joystick controls, except in editor
            #if !UNITY_EDITOR && (UNITY_STANDALONE || UNITY_WEBGL)
            ToggleControls(false);
            #endif

            //on mobile devices enable additional aiming indicator
            #if !UNITY_EDITOR && !UNITY_STANDALONE && !UNITY_WEBGL
            if (aimIndicator != null)
            {
                Transform indicator = Instantiate(aimIndicator).transform;
                indicator.SetParent(GameManager.GetInstance().localPlayer.shotPos);
                indicator.localPosition = new Vector3(0f, 0f, 3f);
            }
            #endif

            //play background music
            AudioManager.PlayMusic(1);
            //don't continue Everyplay initialization on non-supported devices
            if (!UnityEveryplayManager.IsRecordingSupported())
            {
                yield break;
            }

            //set thumbnail used by Everyplay to our image reference, start recording and
            //immediately take a snapshot to be displayed as thumbnail after a short delay
            //this is because Unity Everyplay seems to need some time to initialize properly
            UnityEveryplayManager.InitializeThumbnail(thumbnailImage);
            UnityEveryplayManager.StartRecord();
            yield return(new WaitForSeconds(0.5f));

            UnityEveryplayManager.TakeThumbnail();
        }
Beispiel #2
0
        //initialize variables
        IEnumerator Start()
        {
            if (PlayerPrefs.HasKey(PrefsKeys.cameradistance) || PlayerPrefs.HasKey(PrefsKeys.cameraheight))
            {
                OnCameraHeightChanged(PlayerPrefs.GetFloat(PrefsKeys.cameraheight));
                OnCameraDistanceChanged(PlayerPrefs.GetFloat(PrefsKeys.cameradistance));
            }
            else
            {
                OnCameraHeightChanged(camera.height);
                OnCameraDistanceChanged(camera.distance);
            }

            //get music and effect
            musicToggle.isOn   = bool.Parse(PlayerPrefs.GetString(PrefsKeys.playMusic));
            volumeSlider.value = PlayerPrefs.GetFloat(PrefsKeys.appVolume);

            OnMusicChanged(musicToggle.isOn);
            OnVolumeChanged(volumeSlider.value);

            BotSpawner.ChangElement.AddListener(ChangElement);

            BotSpawner.OnupStatusplayer.AddListener(ButtonStatusOn);

            TimeWave_S.maxValue  = botspawn.TimeWave;
            LevelWave_S.maxValue = 25;
            //on non-mobile devices hide joystick controls, except in editor
            #if !UNITY_EDITOR && (UNITY_STANDALONE || UNITY_WEBGL)
            ToggleControls(false);
            #endif

            //on mobile devices enable additional aiming indicator
//            #if !UNITY_EDITOR && !UNITY_STANDALONE && !UNITY_WEBGL******************************
//            if (aimIndicator != null)
//            {
//                Transform indicator = Instantiate(aimIndicator).transform;
//                indicator.SetParent(GameManager.GetInstance().localPlayer.shotPos);
//                indicator.localPosition = new Vector3(0f, 0f, 3f);
//            }
//            #endif

            //play background music
            AudioManager.PlayMusic(1);
            //don't continue Everyplay initialization on non-supported devices
            if (!UnityEveryplayManager.IsRecordingSupported())
            {
                yield break;
            }

            //set thumbnail used by Everyplay to our image reference, start recording and
            //immediately take a snapshot to be displayed as thumbnail after a short delay
            //this is because Unity Everyplay seems to need some time to initialize properly
            UnityEveryplayManager.InitializeThumbnail(thumbnailImage);
            UnityEveryplayManager.StartRecord();
            yield return(new WaitForSeconds(0.5f));

            UnityEveryplayManager.TakeThumbnail();
        }