void Awake() { I = this; avatarButtons = ProfilesPanel.GetComponentsInChildren <ProfileSelectorAvatarButton>(true); maxProfiles = avatarButtons.Length; }
void OnDestroy() { if (I == this) { I = null; } btAddTween.Kill(); btPlayTween.Kill(); BtAdd.Bt.onClick.RemoveAllListeners(); foreach (ProfileSelectorAvatarButton bt in avatarButtons) { bt.Bt.onClick.RemoveAllListeners(); } }