public void SetUp(BuildingData _myDat, GUI_BuildingBarController _myCont) { myDat = _myDat; nameText.text = myDat.name; img.sprite = myDat.gfxSprite; myCont = _myCont; }
private void Awake() { if (s != null) { Debug.LogError(string.Format("More than one singleton copy of {0} is detected! this shouldn't happen.", this.ToString())); } s = this; myBuildingBarSlots = BuildingBarSlotsParent.GetComponentsInChildren <MiniGUI_BuildingBarSlot>(); GameLoader.CallWhenLoaded(LoadBuildingSlots); }
void DrawInventory() { print("Drawing inventory"); // Draw the buildings bbar = GetComponent <GUI_BuildingBarController>(); foreach (BuildingData dat in DataHolder.s.AllBuildings()) { if (dat.playerBuildBarApplicable) { Instantiate(BuildingListingPrefab, BuildingsParent).GetComponent <MiniGUI_BuildingListing>().SetUp(dat, bbar); } } print(DataHolder.s.AllBuildings().Length.ToString() + " Buildings are put into building list"); }
private void Start() { bbarcont = GetComponent <GUI_BuildingBarController>(); HideAllMenus(); }
private void Start() { myCont = GUI_BuildingBarController.s; }