/// <summary> /// Handles the tap to continue selected event. /// </summary> public void OnTapToContinueSelected() { // turning on either stereo setup FTUE or non FTUE if (FtueDataController.IsFtueComplete(FtueType.Setup)) { // showing non ftue screen NonFtueSetup.gameObject.SetActive(true); NonFtueSetup.GetComponent <Animator>().Play(StereoSetupController.EnterAnimationClip); // hiding ftue screen FtueSetup.gameObject.SetActive(false); } else { // hiding non ftue screen NonFtueSetup.gameObject.SetActive(false); // showing ftue screen FtueSetup.gameObject.SetActive(true); FtueSetup.GetComponent <Animator>().Play(StereoSetupController.EnterAnimationClip); } // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.MenuStart, gameObject); }
private void UpdateQuality(bool Increase) { int currentValue = (int)CurrentQuality; int last = (int)Enum.GetValues(typeof(Quality)).Cast <Quality>().Last(); int first = (int)Enum.GetValues(typeof(Quality)).Cast <Quality>().First(); if (Increase == true) { if (currentValue < last) { currentValue++; // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.PlusButton, gameObject); } } else { if (currentValue > first) { currentValue--; // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.MinusButton, gameObject); } } CurrentQuality = (Quality)currentValue; UpdateQualityBar(currentValue); qualityController.SaveQuality(currentValue); }
protected void ShowErrorPanel(GameObject errorPanel, bool isError) { if (errorPanel == null) { Log.Error("Null reference for errorPanel. Please ensure valid references on DarkSideFtueController."); return; } #if UNITY_EDITOR return; #else // showing/hiding error panel errorPanel.SetActive(isError); // setting flag in FtueAnimationSequence sequence.IsErrorState = isError; // playing audio if isError == true if (isError) { AudioEvent.Play(AudioEventName.Ftue.Stereo.ConnectionNotFound, gameObject); } #endif }
protected void OnSdkFrameUpdate(object sender, EventArgs eventArguments) { if (shouldTrackTime) { currentTime += Time.deltaTime; if (currentTime >= targetTime) { if (onTimerCompleteHandler != null) { onTimerCompleteHandler.Invoke(); } EndTimer(); } } if (isFtueGalaxyMapDisplayed) { interval += Time.deltaTime; if (interval > PlanetSelectionDelay) { // playing planet selection dialog from archivist when idle AudioEvent.Play(AnimationClip_ArchivistSelectNaboo, HolocronContainer); /* * sequence.Play(FtueType.GalaxyMap, AnimationEventName.ArchivistGoAhead); */ isFtueGalaxyMapDisplayed = false; } } }
/// <summary> /// Handles the continue anyway selected event /// </summary> public void OnContinueAnywaySelected() { // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.CheckLaunch, gameObject); SetupController.LoadScene(); }
/// <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(); } }
/// <summary> /// Handler when the exit button is selected /// </summary> public void OnExitButtonSelected() { // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.ExitButton, gameObject); // hide premission denied ui AndroidPermissionDenied.SetActive(false); // hiding the exit popup ExitPopup.SetActive(false); // going back to the title screen TitleController.gameObject.SetActive(true); // displaying welcome screen UpdateScreen(StereoSetupStep.Welcome, false); // resetting nav icons MenuToggleGroup.ResetToggles(); // exiting, so farthest step is back to none farthestStep = StereoSetupStep.None; // hiding the nav icons NavIcons.SetActive(false); // hiding saber not found ui SaberNotFound.SetActive(false); // allow popups to show up if the player starts up FTUE again shouldDisplayAndroidPopup = true; shouldDisplayLocServicesPopup = true; }
protected void OnLightSaberCalibration(CalibrationState state) { if (state == CalibrationState.Complete && calibrationState == -1) { return; } // getting fill amount from calibration state float fillAmount = ((int)state + 1) * .25f; // setting calibration bar CalibrationBar.fillAmount = fillAmount; // displaying calibration complete CalibrationComplete.SetActive(state == CalibrationState.Complete); // playing sound if (state == CalibrationState.Complete && calibrationState != (int)state) { AudioEvent.Play(AudioEventName.Ftue.Stereo.CalibrationSuccess, gameObject); } else { AudioEvent.Play(AudioEventName.Ftue.Stereo.Calibration, gameObject); } // setting calibration state calibrationState = (int)state; }
private void GetToggles() { toggles = transform.GetComponentsInChildren <Toggle>(); foreach (Toggle toggle in toggles) { toggle.onValueChanged.AddListener((isOn) => { if (!isOn) { //fired when you click to turn of off toggle if (OnToggleOff != null) { OnToggleOff(this, new ToggleEventArgs(toggle)); } return; } UpdateGroup(toggle); if (OnToggleChange != null) { OnToggleChange(this, new ToggleEventArgs(toggle)); AudioEvent.Play(AudioEventName.Ftue.Stereo.Swipe, gameObject); } }); } }
public void OnCloseButtonSelected() { // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.ExitButton, gameObject); // displaying title screen TitleController.gameObject.SetActive(true); }
public override void GazedAt() { if (!locked) { OnGameObject.SetActive(true); AudioEvent.Play("MAP_UI_Combat_FirstEncounter_Select", gameObject); } }
protected void OnEnable() { currentTotalIssues = GetNumberOfIssues(); if (previousTotalIssues == currentTotalIssues && currentTotalIssues != 0) { AudioEvent.Play(AudioEventName.Ftue.Stereo.ConnectionNotFound, gameObject); } }
public bool GazeClick() { if (currentButton == null) { return(false); } if (currentButton.Locked) { return(false); } EasyButton.Selected = false; MediumButton.Selected = false; HardButton.Selected = false; CurrentDifficulty = currentButton.Difficulty; currentButton.Selected = true; switch (currentButton.Difficulty) { case Difficulty.Easy: AudioEvent.Play(AudioEventName.Combat.Encounter1, gameObject); break; case Difficulty.Medium: AudioEvent.Play(AudioEventName.Combat.Encounter2, gameObject); break; case Difficulty.Hard: AudioEvent.Play(AudioEventName.Combat.Encounter3, gameObject); break; } // Update all 3 pillars based on new difficulty selection UpdatePillars(); // Update the CurvedUI based on difficulty change if (currentMenuNode != null) { Setup(currentMenuNode); } else if (currentSurfaceNode != null) { if (currentBonusPlanet == null) { Setup(currentSurfaceNode, currentPlanet, false); } else { Setup(currentSurfaceNode, currentBonusPlanet.Value, false); } } return(true); }
public void ResumeClicked() { if (Controller.OnResumeButton != null) { Controller.OnResumeButton.Invoke(this, new EventArgs()); } AudioEvent.Play(AudioEventName.Settings.Resume, gameObject); Controller.ToggleVisiblity(false); }
protected override void OnEnable() { base.OnEnable(); if (!AudioEvent.PlayOnceEver(AudioEventName.Menu.HolocronMasteryFirstTime, gameObject)) { AudioEvent.Play(AudioEventName.Menu.OpenHolocronMaster, gameObject); } AudioEvent.Play(AudioEventName.ProgressionUI.HolocronMasteryButton, gameObject); }
private void PlayStartupAudio() { AudioEvent.Play(AudioEventName.Holocron.CornerSpinIdle, Holocron); // Play everytime after the first time load ContainerAPI container = new ContainerAPI(Game.ForceVision); firstTimeRun = false; container.PlayerPrefs.SetPrefInt(Constants.GalaxyLoadedPlayerPrefKey, 1); }
public void VolumeDown() { float newValue = Mathf.Clamp(Mathf.Floor((Volume.value + -1 * 0.1f) * 10) / 10, 0f, 1f); Volume.value = newValue; container.NativeSettings.SetVolume(Volume.value); SoundIcon.SetState(container.NativeSettings.IsMuted() ? SwitchState.Off : SwitchState.On); AudioEvent.Play(AudioEventName.Ftue.Stereo.MinusButton, gameObject); }
/// <summary> /// Animate all the objects on the pillar. /// </summary> public void AnimatePillar() { foreach (Animator animator in SubAnimators) { if (animator.GetCurrentAnimatorStateInfo(0).IsName("frozen")) { animator.Play("playing"); //Play sound when pillar is clicked AudioEvent.Play("MAP_SFX_Pillar_" + Config.name, gameObject); } } }
protected void OnBeaconStateChange(object sender, BeaconStateChangeEventArgs eventArguments) { if (eventArguments.Tracked) { if (!beaconSeen) { beaconSeen = true; // playing audio - signal acquired AudioEvent.Play(AudioEventName.Ftue.Computer.SignalAcquired, gameObject); } } }
public void GazedAt() { if (Locked || selected) { return; } AudioEvent.Play("MAP_UI_Combat_FirstEncounter_Select", gameObject); DefaultState.SetActive(false); SelectedState.SetActive(false); GazeState.SetActive(true); }
public override void OnClicked() { Enabled = !Enabled; Controller.UpdateSpatializationSetting(Enabled); if (Enabled) { AudioEvent.Play(AudioEventName.Settings.Toggle3dOn, gameObject); } else { AudioEvent.Play(AudioEventName.Settings.Toggle3dOff, gameObject); } }
private void UpdateView() { if (!Application.isEditor) { ContinueAnywayButton.SetActive(SetupController.IsControllerConnected); } LightSaberNotSynced.SetActive(!SetupController.IsControllerConnected); LightSaberNotCalibrated.SetActive(!SetupController.IsPeripheralCalibrated && !FtueDataController.IsFtueComplete(FtueType.Setup)); // only displaying saber battery warning when saber is synced if (!SetupController.IsControllerConnected) { LightSaberLowBattery.SetActive(false); } else { LightSaberLowBattery.SetActive(IsSaberBatteryLow); } PhoneLowBattery.SetActive(IsPhoneBatteryLow); SoundMuted.SetActive(IsSoundMuted); currentTotalIssues = GetNumberOfIssues(); // Handle UI and sounds based on when issues change while on this screen if (previousTotalIssues != currentTotalIssues && gameObject.activeSelf) { if (currentTotalIssues == 0) { Header.SetState(SwitchState.Off); ButtonTextSwitch.SetState(SwitchState.Off); AudioEvent.Play(AudioEventName.Ftue.Stereo.CheckLaunch, gameObject); } else { Header.SetState(SwitchState.On); ButtonTextSwitch.SetState(SwitchState.On); if (currentTotalIssues > previousTotalIssues) { AudioEvent.Play(AudioEventName.Ftue.Stereo.ConnectionNotFound, gameObject); } else { AudioEvent.Play(AudioEventName.Ftue.Stereo.MinusButton, gameObject); } } previousTotalIssues = currentTotalIssues; } }
public override void Clicked() { if (locked || !OnGameObject.activeSelf) { return; } switch (PanelType) { case EquipItemType.ForcePower: StartPanel.SetActive(false); PowerSelectPanel.DisplayForcePowerItems(allForceItems, ownedForceItems, OnItemSelected); PowerSelectPanel.gameObject.SetActive(true); AudioEvent.Play("MAP_UI_GalaxyMap_BeginActivity", gameObject); break; case EquipItemType.PassivePower1: case EquipItemType.PassivePower2: StartPanel.SetActive(false); PowerSelectPanel.DisplayPassivePowerItems(allPassiveItems, ownedPassiveItems, (PassiveAbilityItem)(PanelType == EquipItemType.PassivePower1 ? EquipController.PassivePower2 : EquipController.PassivePower1), OnItemSelected); PowerSelectPanel.gameObject.SetActive(true); AudioEvent.Play("MAP_UI_GalaxyMap_BeginActivity", gameObject); break; case EquipItemType.DifficultyItem: duelApi.Inventory.ForcePowers.UnequipAllItems(); duelApi.Inventory.PassiveAbilities.UnequipAllItems(); if (EquipController.ForcePower != null) { duelApi.Inventory.ForcePowers.EquipItem(EquipController.ForcePower.ID); } if (EquipController.PassivePower1 != null) { duelApi.Inventory.PassiveAbilities.EquipItem(EquipController.PassivePower1.ID); } if (EquipController.PassivePower2 != null) { duelApi.Inventory.PassiveAbilities.EquipItem(EquipController.PassivePower2.ID); } AudioEvent.Play("MAP_UI_GalaxyMap_LaunchActivity", gameObject); duelApi.Inventory.ForcePowers.SaveToDisk(); duelApi.Inventory.PassiveAbilities.SaveToDisk(); EquipController.LaunchGame(assaultApi); break; } }
private void PlayClip(FtueAnimationStep stepToPlay) { DOVirtual.DelayedCall(stepToPlay.Delay, () => { // playing the animation clip FtueAgent currentAgent = agents[(int)stepToPlay.Agent]; currentAgent.PlayAnimation(stepToPlay.Clip); // playing the audio clip if (!string.IsNullOrEmpty(stepToPlay.SoundEvent)) { AudioEvent.Play(stepToPlay.SoundEvent, ftueAudioSource); } }); }
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); }
protected void OnNodeSelected(object sender, MenuNodeEventArgs eventArgs) { // Audio - MAP_UI_GalaxyMap_NodeSelect - playing node selected AudioEvent.Play(AudioEventName.GalaxyMap.NodeSelected, Galaxy); // playing audio clip based on which node type was selected if (eventArgs.NodeType == MenuNodeType.Planet) { bool played = false; // checking if the player has selected Crait (bonus planet) if (eventArgs.BonusPlanet != null) { if (lastSelectedNode == null || !(lastSelectedNode is SurfaceMenuNode)) { played = AudioEvent.PlayOnceEver(AudioEventName.GalaxyMap.SelectCraitFirstTime, Holocron); if (!played && !DidAutoSelectNode) { AudioEvent.Play(AudioEventName.GalaxyMap.SelectCrait, Holocron); DidAutoSelectNode = false; } } } else { if (!pillarSelected) { if (eventArgs.Planet != PlanetType.Naboo) { played = AudioEvent.PlayOnceEver(AudioEventName.Archivist.GalaxyMap.UnlockPlanet.Replace("#planet#", eventArgs.Planet.ToString()), Holocron); } if (!played) { AudioEvent.Play(AudioEventName.Archivist.GalaxyMap.FunFactPlanet.Replace("#planet#", eventArgs.Planet.ToString()), Holocron); } } } pillarSelected = false; } else if (eventArgs.NodeType == MenuNodeType.Pillar || eventArgs.NodeType == MenuNodeType.Surface) { pillarSelected = true; } lastSelectedNode = sender; }
/// <summary> /// Handler for the event when the confirm button is selected /// </summary> public void OnConfirmButtonSelected() { int selectedLanguageId = 0; if (selectedToggle != null && selectedToggle.GetComponent <LanguageDisplay>() != null) { selectedLanguageId = selectedToggle.GetComponent <LanguageDisplay>().GetLanguageId(); } StartCoroutine(ChangeLanguage(Localizer.Locales[selectedLanguageId])); ResetUI(); // playing sound AudioEvent.Play(AudioEventName.Ftue.Stereo.CheckLaunch, gameObject); }
private void Start() { Galaxy.GetComponent <AnimationEvents>().OnAnimationComplete += OnAnimationComplete; MenuNode.OnNodeSelected += OnNodeSelected; MenuNode.OnNodeFocused += OnNodeFocused; MenuNode.OnNodeIdle += OnNodeIdle; // Currently this is ever only a list of one, not sure if wwise auto queues or not Triggers.ForEach(item => { AudioEvent.Play(item, gameObject); }); Triggers.Clear(); }
protected override void OnSelectUpdated(bool state) { if (Container.PlayerPrefs.PrefKeyExists(Constants.PorgUnlocked) || ContainerAPI.AllProgressionUnlocked) { AudioEvent.Play("MAP_MX_TransitionStinger", gameObject); // Load scene on a delay to match the higher loading times of other games // The transition stinger has a delay to compensate, so now all matches Invoke("LoadSceneDelayed", 1f); } else { // TODO should we play some animation or audio? } }
public void LoadScene() { // stopping background music AudioEvent.Play(AudioEventName.Ftue.Stereo.BackgroundMusicStop, gameObject); Application.targetFrameRate = 60; #if IS_DEMO_BUILD if (ContainerAPI.AllProgressionUnlocked) { SG.Lonestar.DuelAPI duelApi = new SG.Lonestar.DuelAPI(); duelApi.Inventory.ForcePowers.GiveAllItems(); duelApi.Inventory.ForcePowers.SaveToDisk(); duelApi.Inventory.PassiveAbilities.GiveAllItems(); duelApi.Inventory.PassiveAbilities.SaveToDisk(); Disney.HoloChess.HolochessStatic.Progress.SetPawnsUnlocked(1000); } else { Log.Debug("clear data."); string path = Application.persistentDataPath; System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(path); foreach (System.IO.FileInfo file in di.GetFiles()) { file.Delete(); } foreach (System.IO.DirectoryInfo dir in di.GetDirectories()) { dir.Delete(true); } Log.Debug("unlock naboo pillars."); (new Disney.AssaultMode.AssaultAPI()).SetRatingForStage(PlanetType.Naboo, 1, (int)Difficulty.Easy, 1); (new Disney.AssaultMode.AssaultAPI()).SetRatingForStage(PlanetType.Naboo, 2, (int)Difficulty.Easy, 1); // Set win on tutorial SG.Lonestar.DuelAPI duelApi = new SG.Lonestar.DuelAPI(); duelApi.Progress.SetVictory(duelApi.Progress.Battles[0], 0); duelApi.Progress.SaveToDisk(); } #endif // loading next scene SceneManager.LoadScene(NextScene); }