public bool CheckIfAchievementIsMet(Achievement a, Transform notificationTransform = null) { //Debug.Log(AchievementsAlreadyUnlocked); //Debug.Log(a.DisplayName); //Debug.Log(AchievementsAlreadyUnlocked[0]); if (UnlockEverythingMode) { return(true); } if (AchievementsAlreadyUnlocked.Contains(a.DisplayName)) { return(a); } else { bool met = a.CheckAchievementMet(); if (met) { AchievementsAlreadyUnlocked.Add(a.DisplayName); if (notificationTransform != null) { GameObject g = Instantiate(UnlockNotificationPrefab, notificationTransform); string d = (a.Description.Length > 0) ? a.Description : a.AutoGenDescription(); g.GetComponent <UnlockNotification>().SetInfo(a.GetComponent <WeaponStats>().Icon, a.GetComponent <WeaponStats>().name, a.DisplayName, d); } } return(met); } }
private GameObject createLockCard(Achievement a, GameObject weapon) { GameObject gi = Instantiate(CardPrefab); if (a.Description.Length == 0) { gi.GetComponent <Card>().SetLockCardInfo(a.DisplayName, a.AutoGenDescription(), weapon); } else { gi.GetComponent <Card>().SetLockCardInfo(a.DisplayName, a.Description, weapon); } gi.GetComponent <Card>().UIManager = this; return(gi); }