public void Add(Model.Buildings.IBuilding b,IBuildingFunction f) { CreateQueueView.Dispatch(new UnityEngine.Vector2(-Screen.width * 0.5f + 128 + m_Queue.Count * 128, 64),b); m_Queue.Add(new KeyValuePair<GameObject, IBuilding>(QueueElements.Last(), b)); m_Functions.Add(new KeyValuePair<IBuildingFunction, IBuilding>(f, b)); Timer t = new Timer(); t.OnStart += t_OnStart; t.OnTick += t_OnTick; t.OnStop += t_OnStop; t.SetTarget(f.TimeRequired); m_Timers.Add(new KeyValuePair<GameObject, Timer>(QueueElements.Last(), t)); m_BuildingTimers.Add(new KeyValuePair<IBuilding, ITimer>(b, t)); t.Start(); AddConstructionPrefab(b,f); }
public void Execute(IBuilding b, IBuildingFunction f) { b.Upgrade(); }
public void Execute(IBuilding b, IBuildingFunction f) { }
public void AddConstructionPrefab(IBuilding b,IBuildingFunction f) { GameObject Pref = BuildingModels.Where(x => x.name == "Construction").FirstOrDefault(); Vector3 Pos = Vector3.zero; GameObject GridTile = Grid.FindGo(b.Tile.X, b.Tile.Z); Pos = GridTile.transform.position; Pos.y += 0.5f; GameObject Inst = GameObject.Instantiate(Pref, Pos, Pref.transform.rotation) as GameObject; m_ConstructionPrefabList.Add(new KeyValuePair<IBuilding, GameObject>(b, Inst)); }