Ejemplo n.º 1
0
        public void DispatchUnit()
        {
            TownEntry entryData        = activeTown.GetComponent <TownEntryDisplay>().townEntry;
            ITown     dispatchTown     = activeTown.GetComponent <TownEntryDisplay>().townEntry.town;
            IUnit     dispatchableUnit = barracks.activeEntry.GetComponent <UnitEntryDisplay>().unitEntry.unit;

            dispatchableUnit.Town = dispatchTown;
            dispatchableUnit.Save();
            barracks.activeEntry.GetComponent <UnitEntryDisplay>().UpdateDisplay(dispatchableUnit);
            unitDisplayController.SetData(dispatchableUnit);
        }
Ejemplo n.º 2
0
        public GameObject CreateTownEntry(ITown town)
        {
            TownEntry townEntryData = TownEntry.CreateInstance(town);

            GameObject townEntryObject = Instantiate(townEntryPrefab) as GameObject;

            townEntryObject.transform.SetParent(townsEntriesPanel.transform);
            townEntryObject.transform.localRotation = Quaternion.identity;
            townEntryObject.transform.localScale    = Vector3.one;

            townEntryObject.GetComponent <TownEntryDisplay>().townEntry = townEntryData;
            townEntryObject.GetComponent <TownEntryDisplay>().SetDisplay();
            townEntryObject.GetComponent <SetActiveTown>().Initialize(SetActiveTown);

            return(townEntryObject);
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     entry = GetComponent <TownEntryDisplay>().townEntry;
 }