public void SetWorkStationInformation(WorkStation Station) { for(int i = 0; i < Main.transform.childCount; i++) { UnlockedWeapon UW = Main.transform.GetChild(i).GetComponent<UnlockedWeapon>(); if (UW.gameObject.activeInHierarchy == false) continue; if (Station.CraftingItem.Information.getID() == UW.getItem().Information.getID()) { if (LastActive != null) { LastActive.SetAsDeselect(UnActive); } UW.SetAsActive(ActiveColor); LastActive = UW; Debug.Log("Ustawiam aktywy kolor"); } UW.StartCraftButton.onClick.AddListener(() => UW.ChangeCraftItem(Station) ); UW.StartCraftButton.onClick.AddListener(() => Deselect()); UW.StartCraftButton.onClick.AddListener(() => UW.SetAsActive(ActiveColor) ); UW.StartCraftButton.onClick.AddListener(() => setLastActive(UW)); } }
public void setLastActive(UnlockedWeapon unlocked) { LastActive = unlocked; }