void Start() { IDmanager = IDManager.Instance; buildManager = BuildManager.Instance; PreviewImage.sprite = IDmanager.GetData(ID).SpritePreview; ShopItemButton.onClick.AddListener(delegate { OnClick(); }); buildManager.OnGridObjectToBuildChanged += delegate { UpdateSelected(); }; }
public void OnClick() { buildManager.SetObjectToBuild(IDmanager.GetData(ID)); }