public void InitializeAndPlay(GameObject poppedBadge, ImmutableDataBadge badgeData) { poppedBadgeController = poppedBadge.GetComponent <BadgeController>(); imageAux.sprite = SpriteCacheManager.GetBadgeSprite(badgeData.ID); transform.position = poppedBadge.transform.position; popAnimation.Play(); }
public void BadgeClicked(GameObject go) { // Get the information from the populated controller AudioManager.Instance.PlayClip("BadgeClicked"); ImmutableDataBadge clickedBadge = DataLoaderBadges.GetData(go.name); descBadgeSprite.sprite = SpriteCacheManager.GetBadgeSprite(BadgeManager.Instance.IsBadgeUnlocked(clickedBadge.ID) ? clickedBadge.ID : null); descBadgeTitle.text = clickedBadge.Name; descBadgeInfo.text = clickedBadge.Description; ShowDescriptionPanel(); }
//---------------------------------------------- // RefreshUnlockPredictions() // Update the items/badge/flame that will be unlocked for next level //---------------------------------------------- private void RefreshUnlockPredictions(object sender, EventArgs args) { foreach (Transform child in gridUnlockPredictions.transform) { child.gameObject.SetActive(false); Destroy(child.gameObject); } ImmutableDataBadge badge = BadgeManager.Instance.GetBadgeUnlockAtNextLevel(); if (badge != null) { GameObject go = GameObjectUtils.AddChildWithPositionAndScale(gridUnlockPredictions, unlockPredictionEntryPrefab); Image sprite = go.GetComponent <Image>(); sprite.sprite = SpriteCacheManager.GetBadgeSprite(badge.TextureName); } ImmutableDataSkill skill = FlameLevelLogic.Instance.GetSkillUnlockAtNextLevel(); if (skill != null) { GameObject go = GameObjectUtils.AddChildWithPositionAndScale(gridUnlockPredictions, unlockPredictionEntryPrefab); Image sprite = go.GetComponent <Image>(); //Place Holder sprite.sprite = SpriteCacheManager.GetSprite(skill.TextureName); } List <Item> items = ItemManager.Instance.GetItemsUnlockAtNextLevel(); foreach (Item item in items) { GameObject go = GameObjectUtils.AddChildWithPositionAndScale(gridUnlockPredictions, unlockPredictionEntryPrefab); Image sprite = go.GetComponent <Image>(); sprite.sprite = SpriteCacheManager.GetSprite(item.TextureName); } }
/// <summary> /// Events from BadgePopController /// </summary> public void FlipSpriteEvent() { image.sprite = SpriteCacheManager.GetBadgeSprite(badgeData.ID); }
public void Init(ImmutableDataBadge _badgeData) { badgeData = _badgeData; isUnlocked = BadgeManager.Instance.IsBadgeUnlocked(_badgeData.ID); image.sprite = SpriteCacheManager.GetBadgeSprite(isUnlocked ? _badgeData.ID : null); }