void OnGUI() { GUILayout.BeginArea( new Rect((Screen.width - width) / 2.0f, 0, width, height), GUI.skin.box ); GUI.Label( new Rect(5, 3, 100, 25), String.Format("Villagers: {0} / {1}", villagerCount, SpawnVillagers.TotalVillagerCapacity()), CurrentCountSkin() ); GUI.Label(new Rect(width - 150, 3, 150, 25), String.Format("Currently {0}", HutBuilding.CurrentStateDescriptor())); GUI.Label( new Rect(5, 28, 100, 25), String.Format("Orcs: {0} / {1}", Ork.AllOrks().Count(), Fort.TotalOrkCapacity()) ); GUI.Label( new Rect(width - 150, 28, 150, 25), String.Format("Time until next fort: {0}s", SpawnForts.TimeUntilNextSpawn()) ); GUI.Label( new Rect((width / 2f) - 35, 50, 80, 25), String.Format("Time: {0}", ProgressTracker.FormattedPlaytime()) ); GUILayout.EndArea(); }
// Use this for initialization void Start() { theInstance = this; spawner = new RandomSpawner(this.transform, minRange, maxRange); stateActions = new Dictionary <BuildState, Action> { { BuildState.SpawningVillagers, WaitForCapacity }, { BuildState.LookingForLocation, FindNextBuildSite }, { BuildState.AssemblingBuilders, GatherBuilders }, { BuildState.BuildingHut, BuildHut } }; SpawnHut(new Vector2(0, 0)); }