public void Start() { Master.SetActive(false); Knight.SetActive(false); Padawan.SetActive(false); Initiate.SetActive(false); switch (ContainerAPI.GetJediRank()) { case JediRank.Master: Master.SetActive(true); break; case JediRank.Knight: Knight.SetActive(true); break; case JediRank.Padawan: Padawan.SetActive(true); break; default: Initiate.SetActive(true); break; } }
public void Init() { if (Locked == null) { return; } switch ((ColorID)ColorId) { case ColorID.GREEN: Locked.SetActive(ContainerAPI.GetJediRank() < JediRank.Padawan); break; case ColorID.PURPLE: Locked.SetActive(!ContainerAPI.IsMedalUnlocked(MedalType.Mastery)); break; case ColorID.BLUE: Locked.SetActive(false); break; } }
private void PlayStartupAudio() { AudioEvent.Play(AudioEventName.Holocron.CornerSpinIdle, Holocron); // Play everytime after the first time load ContainerAPI container = new ContainerAPI(Game.ForceVision); if (firstTimeRun && container.PlayerPrefs.GetPrefInt(Constants.GalaxyLoadedPlayerPrefKey, 0) == 1) { switch (ContainerAPI.GetJediRank()) { case JediRank.Initiate: AudioEvent.Play(AudioEventName.Archivist.GalaxyMap.GalaxyLoadRankInitiate, gameObject); break; case JediRank.Padawan: AudioEvent.Play(AudioEventName.Archivist.GalaxyMap.GalaxyLoadRankPadawan, gameObject); break; case JediRank.Knight: AudioEvent.Play(AudioEventName.Archivist.GalaxyMap.GalaxyLoadRankJediKnight, gameObject); break; case JediRank.Master: AudioEvent.Play(AudioEventName.Archivist.GalaxyMap.GalaxyLoadRankJediMaster, gameObject); break; } } else if (container.PlayerPrefs.GetPrefInt(Constants.GalaxyLoadedPlayerPrefKey, 0) == 0) { AudioEvent.PlayOnceEver(AudioEventName.Holocron.FirstTimeAppears, Holocron); } firstTimeRun = false; container.PlayerPrefs.SetPrefInt(Constants.GalaxyLoadedPlayerPrefKey, 1); }
private void AnimationComplete(object sender, AnimationEventArgs eventArgs) { if (eventArgs.AnimationName.Equals("planet_primaryToRest")) { NavigationController.IsWaitingForAnimationToComplete = false; } if (DeepLinkOnLoad) { if (!isWaitingForPillarsForDeepLinkOnLoadAction) { isWaitingForPillarsForDeepLinkOnLoadAction = true; StartCoroutine(CheckUntilPillarsForDeepLinkOnLoad()); } return; } // galaxy animation completed if (eventArgs.AnimationName.Equals("GalaxyMapTurnsOn")) { ContainerAPI container = new ContainerAPI(Game.ForceVision); // checking if player has defeated Grand Inquisitor bool hasDefeatedGrandInquisitor = ContainerAPI.GetDuelApi().Progress.HasCompleted(SG.Lonestar.DuelAPI.Duelist.GrandInquisitor, 1); // checking if Crait unlock animation has played already bool hasCraitUnlockAnimationPlayed = container.PlayerPrefs.PrefKeyExists(Constants.CraitUnlocked); if (hasDefeatedGrandInquisitor && !hasCraitUnlockAnimationPlayed) { // checking for player rank JediRank playerRank = ContainerAPI.GetJediRank(); if (playerRank <= JediRank.Padawan) { AudioEvent.Play(AudioEventName.GalaxyMap.UnlockCraitNewUser, Holocron, (object in_cookie, AkCallbackType in_type, object in_info) => { PlayCraitUnlockAnimation(); }); } else { // playing unlock animation PlayCraitUnlockAnimation(); } // setting player pref that Crait unlock animation has played container.PlayerPrefs.SetPrefInt(Constants.CraitUnlocked, 1); } // checking if player has completed Crait content bool hasDefeatedPraetorianGuards = ContainerAPI.GetDuelApi().Progress.HasCompleted(SG.Lonestar.DuelAPI.Duelist.PraetorianGuards, 1); bool hasCompletedTowerDefense = BSG.SWARTD.TDAPI.GetInstance().HasWonBattle(BSG.SWARTD.TDAPI.Battles.Crait_3); bool hasPorgUnlockAnimationPlayed = container.PlayerPrefs.PrefKeyExists(Constants.PorgUnlocked); if (hasDefeatedPraetorianGuards && hasCompletedTowerDefense && !hasPorgUnlockAnimationPlayed) { // disabling user input on node selection Animating = true; DG.Tweening.DOVirtual.DelayedCall(3f, () => { MenuAudioController.DidAutoSelectNode = true; NodeSelected(CraitPlanetNode); pillars.PorgUnlockFX.SetActive(true); // enabling user input on node selection Animating = false; }); // saving player prefs for porg unlocking container.PlayerPrefs.SetPrefInt(Constants.PorgUnlocked, 1); } } lastNode.OnAnimationComplete -= AnimationComplete; selectedNode.OnAnimationComplete -= AnimationComplete; // Reattach after animations if (selectedNode.NodeType == MenuNodeType.Galaxy && lastNode.NodeType == MenuNodeType.Planet) { lastNode.GetRootTransform().SetParent(lastNodeParent, true); } // displaying holocron effects (if needed) for (int i = 0; i < HolocronFX.transform.childCount; i++) { Transform child = HolocronFX.transform.GetChild(i); if (!child.gameObject.activeSelf) { child.gameObject.SetActive(true); } } Animating = false; }