// Use this for initialization void Start() { tickRate = 100; currentTick = 0; workerIndex = GameObject.Find("Manager").GetComponent <WorkerIndex>(); food = 13f; stones = 0f; farm = GameObject.Find("Farm").GetComponent <Farm>(); }
// Use this for initialization void Start() { timeCycle = GameObject.Find("Manager").GetComponent <TimeCycle>(); workerIndex = GameObject.Find("Manager").GetComponent <WorkerIndex>(); fire = transform.GetChild(0).gameObject; fire.SetActive(false); Register(); //MoveToSite(WorkSite.Pyramid); }
// Use this for initialization new void Start() { base.Start(); workers = GameObject.Find("Manager").GetComponent <WorkerIndex>(); text = GetComponentInChildren <Text>(); if (name == "Slider_Pyramid") { worksite = GameObject.Find("Pyramid").GetComponent <Site>(); } else if (name == "Slider_Farm") { worksite = GameObject.Find("Farm").GetComponent <Site>(); } maxValue = workers.numWorkers; minValue = 0f; value = worksite.workers.Count; text.text = number.ToString(); }
public override void Publish(Publisher publisher) { if (publisher.GetType() == typeof(Supplies)) { Supplies supplies = (Supplies)publisher; this.food.text = (System.Math.Floor(supplies.food)).ToString(); this.stone.text = (System.Math.Floor(supplies.stones)).ToString(); } else if (publisher.GetType() == typeof(TimeCycle)) { TimeCycle timeCycle = (TimeCycle)publisher; hour = timeCycle.hour; day = timeCycle.daysPassed; time.text = day.ToString() + "d " + hour.ToString() + "h"; } else if (publisher.GetType() == typeof(WorkerIndex)) { WorkerIndex workerIndex = (WorkerIndex)publisher; this.workers.text = workerIndex.GetAllWorkers().Count.ToString(); } }