- Home /
Question by
Laguna_Seca · May 21, 2015 at 03:34 PM ·
errorbuttonsetactivelistener
Do not see the link to an object (It is impossible to make active)
There is a button on which hang Listener
g.gameObject.GetComponent<Button>().onClick.AddListener(() =>
{
_navigation.Buy(amount_on_island, item_weight, title, purchase_price);
_navigation.open_purchase_content_and_close_trade_content();
});
as you can see, he calls two functions, I am interested "open_purchase_content_and_close_trade_content"
its conten:
public void open_purchase_content_and_close_trade_content()
{
_purchase_content.SetActive(true);
Debug.Log(_purchase_content); // NULL
}
"public GameObject _purchase_content;"
Naturally it is given, that is, it appointed object. I have all navigation Built in a similar way, but in this case it is impossible to make an object active.
12.jpg
(14.3 kB)
Comment
Can't understand what you mean. Do you mean you cannot active _purchase_content?