public static void OnLoad() { foreach (RenderableBuilding b in Buildings.Values) { b.Dispose(); } Buildings.Clear(); foreach (RenderablePlot p in Plots.Values) { p.Dispose(); } Plots.Clear(); foreach (Plot p in Haswell.Controller.City.Grid) { if (p.Building != null) { if (p.Building is Road) { Buildings[p.Building] = new RenderableRoad((Road)p.Building); } else { Buildings[p.Building] = new RenderableBuilding(p.Building); } } Plots[p] = new RenderablePlot(p); Plots[p].Create(SceneMgr, cityNode); } GameConsole.ActiveInstance.WriteLine("Game Loaded."); GuiMgr.AddInfoPopup("Game Loaded."); }
public void UpdateGUI(float frametime) { if (CityManager.Initialized) { GuiMgr.SetCurrentCursorBuilding(this.tempBuilding); GuiMgr.Update(frametime); } GuiMgr.DebugPanel[4] = mouseMode.ToString(); }
protected void Awake() { _instance = this; _TransBack = _instance.GetBackCamera().transform; _TransFront = _instance.GetFrontCamera().transform; _TransCache = _instance.transform.Find(strCachePath); _BackUICamera = _TransBack.GetComponent <UICamera>(); InvokeRepeating("RefreshPoolQueue", 0.0f, 1.0f); }
public static void CreateBuildingOnCursor(BuildingConfiguration template) { RenderableBuilding rb = new RenderableBuilding(template); rb.Create(GameMgr.StateMgr.Engine.SceneMgr, cityNode); rb.IsVirtual = true; GameMgr.SetCursorBuilding(rb); GameMgr.SetMouseMode(MouseMode.PlacingBuilding); GuiMgr.ShowBuildingPlacementPanel(); }
/// <summary> /// Add a new building to the city at the specified coordinates /// </summary> /// <param name="x"></param> /// <param name="y"></param> public static void NewBuilding(int x, int y, BuildingConfiguration b) { if (Initialized) { try { Haswell.Controller.City.CreateBuilding(x, y, b); } catch (BuildingCreationFailedException e) { GameConsole.ActiveInstance.WriteLine(e.Message); GuiMgr.AddInfoPopup(e.Message); } } else { GameConsole.ActiveInstance.WriteError("Unable to create building, no city initialized!"); } }
public static void Load() { Haswell.Controller.Load(); GameConsole.ActiveInstance.WriteLine("Loading game..."); GuiMgr.AddInfoPopup("Loading game..."); }
public static void OnSave() { GameConsole.ActiveInstance.WriteLine("Game Saved."); GuiMgr.AddInfoPopup("Game Saved."); }
protected void OnDestroy() { StopAllCoroutines(); _instance = null; }