static void EndMission() { if (GameEnded) { return; } GameEnded = true; MissionOutcome.MakeNew(); TrackingManager.TrackingCall_LevelComplete(GameManager.Instance.ChoosenRegionConfig, MissionOutcome.LastOutcome, PlayerLevel.Instance.GetCurrentLevel()); ShowGameEndPopup(); OnMissionEnded.AttemptCall(); }
public static void TrackingCall_LevelComplete(RegionConfigDataBase level, MissionOutcome outcome, int player_level) { Dictionary <string, object> call = new Dictionary <string, object>(); call["player_level"] = player_level; call["supplies"] = outcome.SuppliesGainedFinal; call["evacuated"] = outcome.SquadUnitsEvaced; call["killed"] = outcome.SquadUnitsKilled; call["started"] = outcome.SquadUnitsStart; call["editor"] = Application.isEditor.ToString(); Analytics.CustomEvent("mission_end_" + level.name, call); }
public MissionOutcome(int _killed, int _evac, int _gainedraw, int _units_start, int _difficulty, float _progress_before, int _old_level, int _new_level) { NewLevel = _old_level < _new_level; SquadUnitsKilled = _killed; SquadUnitsEvaced = _evac; SuppliesGainedRaw = (_evac > 0) ? _gainedraw : 0; SquadUnitsStart = _units_start; RegionDifficulty = _difficulty; ProgressBefore = _progress_before; Bonus = Constants.GetSupplyBonus(SquadUnitsStart, SquadUnitsEvaced, SquadUnitsKilled, RegionDifficulty); SuppliesGainedFinal = (int)(SuppliesGainedRaw * Bonus); LastOutcome = this; }
public void SetView(MissionOutcome outcome) { player_level.gameObject.SetActive(true); player_level.Init(PlayerLevel.Instance); old_bar.gameObject.SetActive(true); player_level.CurrentLevelTF.GetComponent <UI_Anim_BlinkOnEnable>().enabled = outcome.NewLevel; if (outcome.NewLevel) { player_level.CurrentLevelTF.text += " [level up]"; } player_level.CurrentProgressTF.text = "+" + outcome.SuppliesGainedFinal; old_bar.enabled = !outcome.NewLevel; old_bar.SetProgress(outcome.ProgressBefore); }
public void SetView(MissionOutcome outcome, float delay) { LootedDescr.SetActive(false); Looted.gameObject.SetActive(false); BonusDescr.SetActive(false); BonusTF.gameObject.SetActive(false); SurvivedTF.gameObject.SetActive(false); FinalLootDescr.SetActive(false); FinalLootTF.gameObject.SetActive(false); SurvivedTF.text = "(" + outcome.SquadUnitsEvaced.ToString() + " Survived)"; NoLoot.SetActive(outcome.SquadUnitsEvaced == 0); if (outcome.SquadUnitsEvaced > 0) { StopAllCoroutines(); StartCoroutine(Sequnce(outcome, delay)); } }
IEnumerator Sequnce(MissionOutcome outcome, float delay) { yield return(new WaitForSeconds(0.5f + delay)); LootedDescr.SetActive(true); Looted.gameObject.SetActive(true); Looted.text = outcome.SuppliesGainedRaw.ToString(); yield return(new WaitForSeconds(1f)); SurvivedTF.gameObject.SetActive(true); BonusTF.gameObject.SetActive(true); BonusTF.text = (outcome.Bonus).ToString("#%"); BonusDescr.SetActive(true); yield return(new WaitForSeconds(1.5f)); FinalLootDescr.SetActive(true); FinalLootTF.text = outcome.SuppliesGainedFinal.ToString(); FinalLootTF.gameObject.SetActive(true); yield break; }
public static void MakeNew() { LastOutcome = new MissionOutcome(SquadManager.Instance, PlayerLevel.Instance, PlayerInventory.Instance, GameManager.Instance); }