void Awake() { if (Instance == null) { Instance = this; } else { DestroyImmediate(gameObject); } // PlayerPrefs.SetString("TetherHead_1", "False"); //PlayerPrefs.DeleteAll(); }
public void Init() { image = GetComponent <Image>(); text = transform.GetChild(0).GetComponent <Text>(); skin = transform.GetChild(1).GetComponent <Image>(); skin.preserveAspect = true; padlock = transform.GetChild(2).GetComponent <Image>(); SetSprite(); shopButtonHandler = ShopButtonHandler.Instance; if (shopButtonHandler.GetCurrentTetherHead().ID == ID) { ShowBackground(); } padlock.enabled = locked; unlockAt = shopButtonHandler.TetherUnlocks[ID]; text.text = unlockAt > 0 ? unlockAt.ToString() : ""; isInit = true; }
public void AttachHandler(ShopButtonHandler handler) { this.handler = handler; }