/// <summary> /// Sets up all traits, mentalities, parties, policies etc and starts the game. This happens after map generation for all clients. /// </summary> /// <param name="seed">Seed is used to synchronize in multiplayer</param> public void StartGame(int seed) { UnityEngine.Random.InitState(seed); UI.LoadingScreen.gameObject.SetActive(false); Year = 1999; Map.InitializeMap(showRegionBorders: true, showShorelineBorders: true, showContinentBorders: false, showWaterConnections: false, MapColorMode.Basic, MapTextureMode.None); UI.MapControls.Init(this, MapDisplayMode.NoOverlay); VfxManager.Init(this); InitGeograhyTraits(); InitMentalities(); InitParties(); InitPolicies(); UI.SidePanelFooter.Init(this); MarkovChainWordGenerator.Init(); Constitution = new Constitution(this); UI.Constitution.Init(Constitution); StartNextElectionCycle(); // Start first cycle SetAllDistrictsVisible(); CameraHandler.FocusDistricts(VisibleDistricts.Values.ToList()); State = GameState.PreparationPhase; UI.SelectTab(Tab.Parliament); ElectionAnimationHandler = new ElectionAnimationHandler(this); }
// Start is called before the first frame update void Start() { BackButton.onClick.AddListener(() => UI.SelectTab(Tab.DistrictList)); // Popularity breakdown triggers EventTrigger popularityTrigger = PopularityText.gameObject.AddComponent <EventTrigger>(); EventTrigger.Entry mouseEnterEntry = new EventTrigger.Entry(); mouseEnterEntry.eventID = EventTriggerType.PointerEnter; mouseEnterEntry.callback.AddListener((x) => { PopularityBreakdown.gameObject.SetActive(true); PopularityBreakdown.Init(CurrentDistrict, UI.Game.LocalPlayerParty); }); popularityTrigger.triggers.Add(mouseEnterEntry); EventTrigger.Entry mouseExitEntry = new EventTrigger.Entry(); mouseExitEntry.eventID = EventTriggerType.PointerExit; mouseExitEntry.callback.AddListener((x) => PopularityBreakdown.gameObject.SetActive(false)); popularityTrigger.triggers.Add(mouseExitEntry); }