Ejemplo n.º 1
0
 private void CreateItems(QuestParam questParam)
 {
     if (questParam.bonusObjective == null)
     {
         return;
     }
     for (int index = 0; index < questParam.bonusObjective.Length; ++index)
     {
         QuestBonusObjective bonusObjective = questParam.bonusObjective[index];
         QuestMissionItem    rewardItem     = this.CreateRewardItem(bonusObjective);
         if (bonusObjective.itemType == RewardType.ConceptCard)
         {
             ConceptCardIcon componentInChildren = (ConceptCardIcon)((Component)rewardItem).get_gameObject().GetComponentInChildren <ConceptCardIcon>();
             if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
             {
                 ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(bonusObjective.item);
                 componentInChildren.Setup(cardDataForDisplay);
             }
         }
         rewardItem.SetGameParameterIndex(index);
         this.m_ListItems.Add(new QuestDetail.ViewParam()
         {
             ListItem     = rewardItem,
             MissionIndex = index,
             IsAchieved   = questParam.IsMissionClear(index)
         });
         GameParameter.UpdateAll(((Component)rewardItem).get_gameObject());
     }
 }
        private QuestMissionItem CreateMissionItem(QuestBonusObjective bonusObjective)
        {
            if (bonusObjective == null)
            {
                return((QuestMissionItem)null);
            }
            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)((Component)this.m_MissionItemTemplate).get_gameObject());

            gameObject.SetActive(true);
            gameObject.get_transform().SetParent(((Component)this.m_MissionListParent).get_transform(), false);
            return((QuestMissionItem)gameObject.GetComponent <QuestMissionItem>());
        }
 private void CreateResetMissionItems(QuestParam questParam)
 {
     this.DeleteMissionItems();
     if (questParam == null || questParam.bonusObjective == null || (Object.op_Equality((Object)this.m_MissionListParent, (Object)null) || Object.op_Equality((Object)this.m_MissionItemTemplate, (Object)null)))
     {
         return;
     }
     if (this.m_MissionListItems == null)
     {
         this.m_MissionListItems = new List <GameObject>();
     }
     DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
     for (int index = 0; index < questParam.bonusObjective.Length; ++index)
     {
         QuestBonusObjective bonusObjective = questParam.bonusObjective[index];
         if (!questParam.IsMissionClear(index) && bonusObjective.IsProgressMission())
         {
             QuestMissionItem missionItem = this.CreateMissionItem(bonusObjective);
             missionItem.SetGameParameterIndex(index);
             this.m_MissionListItems.Add(((Component)missionItem).get_gameObject());
             GameParameter.UpdateAll(((Component)missionItem).get_gameObject());
         }
     }
 }
Ejemplo n.º 4
0
        private QuestMissionItem CreateRewardItem(QuestBonusObjective bonusObjective)
        {
            if (bonusObjective == null)
            {
                return((QuestMissionItem)null);
            }
            QuestMissionItem questMissionItem;

            if (bonusObjective.itemType == RewardType.Artifact)
            {
                questMissionItem = this.m_RewardArtifactTemplate;
            }
            else if (bonusObjective.itemType == RewardType.ConceptCard)
            {
                questMissionItem = this.m_RewardCardTemplate;
            }
            else if (bonusObjective.itemType == RewardType.Nothing)
            {
                questMissionItem = this.m_RewardNothingTemplate;
            }
            else
            {
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(bonusObjective.item);

                if (itemParam == null)
                {
                    return((QuestMissionItem)null);
                }
                questMissionItem = itemParam.type != EItemType.Unit ? this.m_RewardItemTemplate : this.m_RewardUnitTemplate;
            }
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)((Component)questMissionItem).get_gameObject());

            gameObject.SetActive(true);
            gameObject.get_transform().SetParent(((Component)this.m_ContentRoot).get_transform(), false);
            return((QuestMissionItem)gameObject.GetComponent <QuestMissionItem>());
        }
Ejemplo n.º 5
0
        private void RefreshQuestMissionReward(QuestParam questParam)
        {
            if (questParam.bonusObjective == null)
            {
                return;
            }
            for (int index = 0; index < questParam.bonusObjective.Length; ++index)
            {
                QuestBonusObjective questBonusObjective = questParam.bonusObjective[index];
                QuestMissionItem    questMissionItem;
                if (questBonusObjective.itemType == RewardType.Artifact)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ArtifactTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                }
                else if (questBonusObjective.itemType == RewardType.ConceptCard)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ConceptCardTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                    ConceptCardIcon component = (ConceptCardIcon)((Component)questMissionItem).get_gameObject().GetComponent <ConceptCardIcon>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(questBonusObjective.item);
                        component.Setup(cardDataForDisplay);
                    }
                }
                else if (questBonusObjective.itemType == RewardType.Nothing)
                {
                    questMissionItem = (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.NothingRewardTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                }
                else
                {
                    ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(questBonusObjective.item);

                    if (itemParam != null)
                    {
                        questMissionItem = itemParam.type != EItemType.Unit ? (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.ItemTemplate).get_gameObject())).GetComponent <QuestMissionItem>() : (QuestMissionItem)((GameObject)Object.Instantiate <GameObject>((M0)((Component)this.UnitTemplate).get_gameObject())).GetComponent <QuestMissionItem>();
                    }
                    else
                    {
                        continue;
                    }
                }
                if (!Object.op_Equality((Object)questMissionItem, (Object)null))
                {
                    if (Object.op_Inequality((Object)questMissionItem.Star, (Object)null))
                    {
                        questMissionItem.Star.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.FrameParam, (Object)null))
                    {
                        questMissionItem.FrameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.IconParam, (Object)null))
                    {
                        questMissionItem.IconParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.NameParam, (Object)null))
                    {
                        questMissionItem.NameParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.AmountParam, (Object)null))
                    {
                        questMissionItem.AmountParam.Index = index;
                    }
                    if (Object.op_Inequality((Object)questMissionItem.ObjectigveParam, (Object)null))
                    {
                        questMissionItem.ObjectigveParam.Index = index;
                    }
                    Rect rect = (((Component)questMissionItem).get_transform() as RectTransform).get_rect();
                    // ISSUE: explicit reference operation
                    this.m_ItemHeight = ((Rect)@rect).get_height();
                    ((Component)questMissionItem).get_gameObject().SetActive(true);
                    ((Component)questMissionItem).get_transform().SetParent(this.ContentsParent.get_transform(), false);
                    this.allStarObjects.Add(((Component)questMissionItem.Star).get_gameObject());
                    GameParameter.UpdateAll(((Component)questMissionItem).get_gameObject());
                }
            }
            if (!Object.op_Inequality((Object)this.ScrollRect, (Object)null))
            {
                return;
            }
            this.ScrollRect.set_verticalNormalizedPosition(1f);
            this.ScrollRect.set_horizontalNormalizedPosition(1f);
        }