public override void Init()
        {
            container    = new ContainerAPI(Game);
            Volume.value = container.NativeSettings.GetVolume();
            SaberColorSelected((int)container.GetSavedSaberColorID(), true);
            UpdateBatteryLevels();
            SpatializationElement.Enabled = container.UseSpatialization();

            base.Init();
        }
示例#2
0
        private void OnSDKReady()
        {
            Log.Debug("SDK Ready");
            Analytics.LogAction(new ActionAnalytics("ready.sdk"));

            if (!fadeHandler)
            {
                fadeHandler = GetComponent <FadeHandler>();
            }
            if (!fadeHandler)
            {
                fadeHandler = gameObject.AddComponent <FadeHandler>();
            }

            MainNavigation.Setup(Sdk, false);
            fadeHandler.Setup(MainNavigation, Menu.GetComponent <Animator>());

            // Add the audio Listener
            Sdk.StereoCamera.gameObject.AddComponent <AkAudioListener>();

            // Setup Controllers
            if (!ControllerTransform)
            {
                ControllerTransform = (new GameObject("ControllerTransform")).transform;
            }
            ControllerPeripheral controller = new ControllerPeripheral(VisionSDK.ControllerName,
                                                                       ControllerTransform,
                                                                       null,
                                                                       container.GetSavedSaberColorID());

            controller.UsePositionPrediction = UsePrediction;
            Sdk.Connections.AddPeripheral(controller);

            ControllerTransform.gameObject.SetActive(false);

            Sdk.Tracking.OnBeaconStateChange += OnBeaconStateChanged;

            // Input Events
            Sdk.Connections.OnPeripheralStateChange += OnPeripheralStateChange;
            Sdk.Input.OnButtonDown  += OnButtonDown;
            Sdk.Input.OnButtonUp    += OnButtonUp;
            Sdk.Input.OnButtonPress += OnButtonPress;

            // Make Lenovo one-time call
            StartCoroutine(MakeLenovoOneTimeCall());

            // We are already looking at the beacon
            if (Application.isEditor || Sdk.Tracking.IsBeaconTracked)
            {
                beaconSeenOnce = true;

                Menu.Setup();
            }
        }
示例#3
0
        protected void OnSdkReady()
        {
            // no further initialization needed if FTUE is complete
            if (FtueDataController.IsFtueComplete(FtueType.Intro))
            {
                return;
            }

            // adding controller
            saberPeripheral = new ControllerPeripheral(VisionSDK.ControllerName,
                                                       ControllerTransform,
                                                       null,
                                                       container.GetSavedSaberColorID());
            Sdk.Connections.AddPeripheral(saberPeripheral);

            // adding beacon
            Sdk.Tracking.OnBeaconStateChange += OnBeaconStateChange;

            // checking beacon signal
            if (Sdk.Tracking.IsBeaconTracked)
            {
                beaconSeen = true;

                // playing audio - signal acquired
                AudioEvent.Play(AudioEventName.Ftue.Computer.SignalAcquired, gameObject);
            }
            else
            {
                // playing audio - searching for signal
                AudioEvent.Play(AudioEventName.Ftue.Computer.AcquireSignal, gameObject);
            }

            // setting input handler
            Sdk.Input.OnButtonDown += OnButtonDown;

            // adding input listeners
            Sdk.Connections.OnPeripheralStateChange += OnPeripheralConnected;
            Sdk.Connections.OnPeripheralStateChange += OnPeripheralDisconnected;

            // adding animation listener
            HolocronAnimations.OnAnimationComplete += OnHolocronEnterAnimationComplete;

            // loading animation sequence config
            StreamingAssetsStorage loader = new StreamingAssetsStorage(Game.ForceVision, null);

            loader.LoadStreamingAssetsText(AnimationConfigFile, OnConfigLoaded, true);

            // playing sound
            AudioEvent.Play(AudioEventName.Ftue.MusicStart, gameObject);
        }
示例#4
0
        protected void OnSdkReady()
        {
            // no further initialization needed if FTUE is complete
            if (FtueDataController.IsFtueComplete(FtueType.DarkSide))
            {
                return;
            }

            // adding controller
            saberPeripheral = new ControllerPeripheral(
                VisionSDK.ControllerName,
                ControllerTransform,
                null,
                container.GetSavedSaberColorID()
                );
            Sdk.Connections.AddPeripheral(saberPeripheral);

            // adding beacon
            Sdk.Tracking.OnBeaconStateChange += OnBeaconStateChange;

            // checking beacon signal
            if (Sdk.Tracking.IsBeaconTracked)
            {
                beaconSeen = true;
            }
            else
            {
            }

            // setting input handler
            Sdk.Input.OnButtonDown += OnButtonDown;

            // adding input listeners
            Sdk.Connections.OnPeripheralStateChange += OnPeripheralConnected;
            Sdk.Connections.OnPeripheralStateChange += OnPeripheralDisconnected;

            // loading animation sequence config
            StreamingAssetsStorage loader = new StreamingAssetsStorage(Game.ForceVision, null);

            loader.LoadStreamingAssetsText(AnimationConfigFile, OnConfigLoaded, true);

            // playing the menu FTUE animation
            Menu.GetComponent <Animator>().Play(MenuFtue);
        }
示例#5
0
        private void OnSDKReady()
        {
            // Add the audio Listener
            Sdk.StereoCamera.transform.gameObject.AddComponent <AkAudioListener>();

            // Setup Controllers
            ControllerPeripheral controller = new ControllerPeripheral(
                VisionSDK.ControllerName,
                new GameObject("Controller").transform,
                null,
                container.GetSavedSaberColorID());

            controller.UsePositionPrediction = UsePrediction;
            Sdk.Connections.AddPeripheral(controller);

            // Input Events
            Sdk.Input.OnButtonDown += OnButtonDown;

            HMDConnectPopup.Setup(Sdk, null);
        }
示例#6
0
        private void OnSDKReady()
        {
            if (MenuController.ConfigToLoad)
            {
                MainNav.Game = MenuController.ConfigToLoad.Game;
            }
            else
            {
                MainNav.Game = Game.Duel;
            }
            MainNav.Setup(Sdk, false);
            MainNav.OnMenuShown     += OnMenuShown;
            MainNav.OnMenuHidden    += OnMenuHidden;
            MainNav.OnQuitButton    += OnMenuQuit;
            MainNav.OnRestartButton += OnMenuRestart;

            // Add the audio Listener
            Sdk.StereoCamera.gameObject.AddComponent <AkAudioListener>();

            // Setup Controllers
            ControllerPeripheral controller = new ControllerPeripheral(VisionSDK.ControllerName, null, null, container.GetSavedSaberColorID());

            controller.UsePositionPrediction = UsePrediction;
            Sdk.Connections.AddPeripheral(controller);

            // Input Events
            Sdk.Input.OnButtonUp += OnButtonUp;
        }