/*void Start() * { * statsVisible = popUp.statsVisible; * picVisible = popUp.picVisible; * * SetText(); * * if (picVisible == true) * { * SetPicture(); * } * * SetBg(); * * buttonAmount = popUp.buttonAmount; //How many buttons there are (1 or 2) * * button1 = popUp.button1; //The first button * button2 = popUp.button2; //The second button * * SetPopupSize(); * * SetButtons(); * * SetPopupSize(); * }*/ public void ActivatePopup() { gm = GameObject.Find("GameManager"); purpose = popUp.purpose; removeCurrencyAmount = popUp.removeCurrencyAmount; addCurrencyAmount = popUp.addCurrencyAmount; currencyManager = gm.GetComponent <CurrencyManager>(); nig = gm.GetComponent <NewItemGenerator>(); popUpFrame = GameObject.Find("Empty PopUp Background"); SetBg(); statsVisible = popUp.statsVisible; SetText(); picVisible = popUp.picVisible; if (picVisible == true) { SetPicture(); } SetPopupSize(); buttonAmount = popUp.buttonAmount; SetButtons(); SetPopupSize(); }
private void Awake() { if (instance != null) { Debug.LogWarning("Paska koodaaja nyt on 2 inventoryy"); return; } instance = this; }