When testing with print statements the script does reach the statement:
shopper.SetActiveShop(null);
for closing down the shop in the Close method in the ShopUI script.
Additional checks show that everything leads to the shopper script so i am trying to see if I am missing something there but everything looks set correctly.
The Quit Button OnClick event is setup connected to the ShopUI then calling the ShopUI,Close function.
I know it works as it will call the print(“Close”); statement I made to test. So I think something is not calling in Shopper.
namespace RPG.Shops
{
public class Shopper : MonoBehaviour
{
Shop activeShop = null;
public event Action activeShopChange;
public void SetActiveShop(Shop shop)
{
activeShop = shop;
if (activeShop != null)
{
activeShopChange();
}
}
public Shop GetActiveShop()
{
return activeShop;
}
}
}