Ejemplo n.º 1
0
    public override void OnEnter()
    {
        ShowRewardPopup showRewardPopup = new ShowRewardPopup.Builder(PopupType, Reward.ToReward()).setHeaderText(PopupSplashText).setShowXpAndCoinsUI(ShowXpAndCoinsUI).Build();

        showRewardPopup.Execute();
        Service.Get <EventDispatcher>().AddListener <RewardEvents.RewardPopupComplete>(onRewardPopupComplete);
    }
Ejemplo n.º 2
0
        public Reward GetInRoomReward(List <string> newRewards)
        {
            Reward reward = new Reward();

            foreach (string newReward in newRewards)
            {
                GameObject gameObject = GameObject.Find(newReward);
                if (!(gameObject != null))
                {
                    continue;
                }
                Collectible[] array = gameObject.GetComponents <Collectible>();
                if (array.Length == 0)
                {
                    ShakeCollectible componentInParent = gameObject.GetComponentInParent <ShakeCollectible>();
                    if (componentInParent == null)
                    {
                        continue;
                    }
                    SceneryCollectible[] array2 = UnityEngine.Object.FindObjectsOfType <SceneryCollectible>();
                    List <Collectible>   list   = new List <Collectible>();
                    SceneryCollectible[] array3 = array2;
                    foreach (SceneryCollectible sceneryCollectible in array3)
                    {
                        if (sceneryCollectible.originalParent == componentInParent.transform)
                        {
                            list.Add(sceneryCollectible);
                        }
                    }
                    array = list.ToArray();
                }
                Collectible[] array4 = array;
                foreach (Collectible collectible in array4)
                {
                    RewardDefinition rewardDef = collectible.RewardDef;
                    if (rewardDef != null)
                    {
                        reward.AddReward(rewardDef.ToReward());
                    }
                }
            }
            return(reward);
        }