/// <summary>
        /// Raises the enter headset mode event.
        /// </summary>
        public void OnEnterHeadsetMode()
        {
            KpiTracking.TrackSceneLoadTime();

            // TODO: mathh010 remove once enter headset mode button is removed
            // updating ftue data

            if (IssueController.TotalIssues > 0)
            {
                // checking for issues
                IssueController.gameObject.SetActive(true);
            }
            else
            {
                // playing sound
                AudioEvent.Play(AudioEventName.Ftue.Stereo.CheckLaunch, gameObject);

                if (!FtueDataController.IsFtueComplete(FtueType.Setup))
                {
                    FtueDataController.SetFtueComplete(FtueType.Setup);
                }

                // launching the appropriate game scene
                SetupController.LoadScene();
            }
        }
        private void OnPeripheralStateChange(object sender, PeripheralStateChangeEventArgs eventArguments)
        {
            Sdk.Logger.Log("Is " + eventArguments.Peripheral.Name + " Connected? " + eventArguments.Connected);

            if (eventArguments.Peripheral is ControllerPeripheral)
            {
                // stopping the pairing process
                Sdk.Tracking.StopPairing();
            }
            else if (eventArguments.Peripheral is HmdPeripheral)
            {
                if (eventArguments.Peripheral.Connected)
                {
                    KpiTracking.TrackSceneLoadTime();

                    // dispatching the HMD connected event
                    if (StereoSetupEvents.OnHmdConnected != null)
                    {
                        StereoSetupEvents.OnHmdConnected();
                    }
                }
                else
                {
                    // dispatching the HMD disconnected event
                    if (StereoSetupEvents.OnHmdDisconnected != null)
                    {
                        StereoSetupEvents.OnHmdDisconnected();
                    }
                }
            }
        }
예제 #3
0
 /// <summary>
 /// Handler for the play button.
 /// </summary>
 public void OnPlayButton()
 {
     if (bluetoothOn || Application.isEditor)
     {
         KpiTracking.TrackSceneLoadTime();
         SceneManager.LoadScene(PlayButtonScene);
     }
 }
예제 #4
0
        public void OnEnterHeadsetMode()
        {
            KpiTracking.TrackSceneLoadTime();

            if (IssueController.TotalIssues > 0)
            {
                // checking for issues
                IssueController.gameObject.SetActive(true);
            }
            else
            {
                // playing sound
                AudioEvent.Play(AudioEventName.Ftue.Stereo.CheckLaunch, gameObject);

                // launching the game
                SetupController.LoadScene();
            }
        }
예제 #5
0
        private static void OnBeforeSceneLoadRuntimeMethod()
                #endif
        {
            if (isInitialized == false)
            {
#if !ENABLE_LOGS
                Debug.unityLogger.logEnabled = false;
                Ximmerse.InputSystem.XDevicePlugin.s_isLogEnabled = false;
#endif

                //init app config
                IApplicationConfig ApplicationConfig = new Config();

#if !UNITY_EDITOR_WIN
                //init analytics
                Analytics.Init(ApplicationConfig.GetPlatformConfig(ServiceType.Swrve));

                //init Crittercism
                Crittercism.Init(ApplicationConfig.GetPlatformConfig(ServiceType.Apteligent).Id);
                Crittercism.SetLogUnhandledExceptionAsCrash(false);
#endif

#if !UNITY_EDITOR
                //init KpiTracking
                KpiTracking.InitKpiTracking();
#endif

                //init remote logging
                                #if !RC_BUILD
                remoteLogger = new LogRemote(DefaultLogRemotePort);
                Log.Debug("remoteLogger = " + remoteLogger);

                SceneManager.sceneLoaded += OnSceneLoaded;
                                #endif

                                #if !SKU_CHINA
                DownloadController.PurgeCpipeCache();
                                #endif

                isInitialized = true;
            }
        }
예제 #6
0
        IEnumerator SetStaticReference()
        {
            yield return(new WaitForEndOfFrame());

            KpiTracking.kpiTracking = this;
        }
예제 #7
0
        /// <summary>
        /// Launch the game!
        /// </summary>
        public void Launch()
        {
            // Stop ALl before loading into a game
            AkSoundEngine.StopAll();

            // Audio - MAP_UI_GalaxyMap_SelectGame - playing selected game audio
            AudioEvent.Play(AudioEventName.GalaxyMap.SelectGame, gameObject);
            AudioEvent.Play(AudioEventName.GalaxyMap.TransitionStinger, gameObject);

            //track scene load time
            KpiTracking.TrackSceneLoadTime();

            MenuController.ConfigToLoad = Config;

            if (SkipLevelType > 0)
            {
                if (SkipLevelType == 1)
                {
                    switch (Config.Game)
                    {
                    case Game.Duel:
                        DuelAPI api = ContainerAPI.GetDuelApi();
                        for (int i = 0; i < api.Progress.Battles.Length; i++)
                        {
                            if (api.Progress.Battles[i].DuelistIdentifier == Config.Duelist)
                            {
                                api.Inventory.ForcePowers.GiveAllItems();
                                api.Inventory.ForcePowers.SaveToDisk();
                                api.Inventory.PassiveAbilities.GiveAllItems();
                                api.Inventory.PassiveAbilities.SaveToDisk();
                                api.Progress.SetVictory(api.Progress.Battles[i], (int)MenuController.DifficultyToLoad);
                                api.Progress.SaveToDisk();
                                break;
                            }
                        }
                        break;

                    case Game.Assault:
                        AssaultAPI assaultApi = new AssaultAPI();
                        if (Config.IsBonusPlanet)
                        {
                            assaultApi.SetRatingForStage(Config.BonusPlanet, Config.PillarNumber, (int)MenuController.DifficultyToLoad, 1);
                        }
                        else
                        {
                            assaultApi.SetRatingForStage(Config.Planet, Config.PillarNumber, (int)MenuController.DifficultyToLoad, 1);
                        }
                        break;

                    case Game.HoloChess:
                        (new HolochessAPI()).CompleteLevel(Config, true);
                        break;

                    case Game.TowerDefense:
                        TDAPI.GetInstance().DebugWinBattle(Config.Battle);
                        break;
                    }
                }

                (new ContainerAPI(Game.ForceVision)).FinishLevel(SkipLevelType == 1);

                return;
            }

            ForceVisionAnalytics.LogGameStart();

            switch (Config.Game)
            {
            case Game.Duel:
            case Game.Assault:
                DuelAPI duelApi = ContainerAPI.GetDuelApi();
                int     force   = duelApi.Inventory.ForcePowers.GetOwnedItems().Count;
                int     passive = duelApi.Inventory.PassiveAbilities.GetOwnedItems().Count;

                // They have powers to equip
                if (force > 0 || passive > 0)
                {
                    SceneManager.LoadScene("Equip");
                }
                else
                {
                    if (Config.Game == Game.Assault)
                    {
                        AssaultAPI assaultApi = new AssaultAPI();
                        if (MenuController.ConfigToLoad.IsBonusPlanet)
                        {
                            assaultApi.StartAssaultMode(MenuController.ConfigToLoad.BonusPlanet, MenuController.ConfigToLoad.PillarNumber, (int)MenuController.DifficultyToLoad);
                        }
                        else
                        {
                            assaultApi.StartAssaultMode(MenuController.ConfigToLoad.Planet, MenuController.ConfigToLoad.PillarNumber, (int)MenuController.DifficultyToLoad);
                        }

                        /*
                         * assaultApi.StartAssaultMode(MenuController.ConfigToLoad.Planet,
                         *                          MenuController.ConfigToLoad.PillarNumber,
                         *                          (int)MenuController.DifficultyToLoad);
                         */
                    }
                    else
                    {
                        duelApi.Launch(MenuController.ConfigToLoad.Duelist, (int)MenuController.DifficultyToLoad);
                    }
                }
                break;

            case Game.TowerDefense:
                TDAPI.GetInstance().LaunchBattle(Config.Battle);
                break;

            case Game.HoloChess:
                HolochessAPI holoChessApi = new HolochessAPI();
                holoChessApi.StartHolochess(Config);
                break;
            }
        }