private bool InializeHistoryList()
 {
     if (this.mHistorySets == null || this.mHistorySets.Count < 0)
     {
         DebugUtility.LogError("召喚履歴が存在しません");
         return(false);
     }
     if (Object.op_Equality((Object)this.NodeTemplate, (Object)null))
     {
         DebugUtility.LogError("召喚履歴ノードの指定されていません");
         return(false);
     }
     this.mListObjects.Clear();
     for (int index = 0; index < this.mHistorySets.Count; ++index)
     {
         GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.NodeTemplate);
         if (Object.op_Inequality((Object)gameObject, (Object)null))
         {
             gameObject.SetActive(true);
             GachaHistoryItemData data = new GachaHistoryItemData(this.mHistorySets[index], this.mTitleName, this.mDropAt);
             if (data == null)
             {
                 DebugUtility.LogError("GachaHistoryItemDataの生成に失敗しました");
             }
             else
             {
                 DataSource.Bind <GachaHistoryItemData>(gameObject, data);
                 gameObject.get_transform().SetParent(this.NodeTemplate.get_transform().get_parent(), false);
                 this.mListObjects.Add(gameObject);
             }
         }
     }
     return(true);
 }
Exemple #2
0
        private void Initalize()
        {
            GachaHistoryItemData dataOfClass = DataSource.FindDataOfClass <GachaHistoryItemData>(((Component)this).get_gameObject(), (GachaHistoryItemData)null);

            if (dataOfClass == null)
            {
                DebugUtility.LogError("履歴が存在しません");
            }
            else
            {
                Dictionary <string, List <ArtifactData> > dictionary = new Dictionary <string, List <ArtifactData> >();
                for (int index = dataOfClass.historys.Length - 1; index >= 0; --index)
                {
                    GachaHistoryData history = dataOfClass.historys[index];
                    if (history != null)
                    {
                        if (history.type == GachaDropData.Type.Unit)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.UnitIconObj);
                            if (Object.op_Inequality((Object)gameObject, (Object)null))
                            {
                                gameObject.get_transform().SetParent(this.ListParent, false);
                                gameObject.SetActive(true);
                                DataSource.Bind <UnitData>(gameObject, GachaHistoryWindow.CreateUnitData(history.unit));
                                NewBadgeParam data = new NewBadgeParam(true, history.isNew, NewBadgeType.Unit);
                                DataSource.Bind <NewBadgeParam>(gameObject, data);
                                this.mItems.Add(gameObject);
                                gameObject.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Item)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemIconObj);
                            if (Object.op_Inequality((Object)gameObject, (Object)null))
                            {
                                gameObject.get_transform().SetParent(this.ListParent, false);
                                gameObject.SetActive(true);
                                DataSource.Bind <ItemData>(gameObject, GachaHistoryWindow.CreateItemData(history.item, history.num));
                                NewBadgeParam data = new NewBadgeParam(true, history.isNew, NewBadgeType.Item);
                                DataSource.Bind <NewBadgeParam>(gameObject, data);
                                this.mItems.Add(gameObject);
                                gameObject.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Artifact)
                        {
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactIconObj);
                            if (Object.op_Inequality((Object)gameObject, (Object)null))
                            {
                                gameObject.get_transform().SetParent(this.ListParent, false);
                                gameObject.SetActive(true);
                                DataSource.Bind <ArtifactData>(gameObject, GachaHistoryWindow.CreateArtifactData(history.artifact, history.rarity));
                                bool isnew = false;
                                if (dictionary.ContainsKey(history.artifact.iname))
                                {
                                    if (dictionary[history.artifact.iname].Count > 0)
                                    {
                                        dictionary[history.artifact.iname].RemoveAt(0);
                                    }
                                    isnew = dictionary[history.artifact.iname].Count <= 0;
                                }
                                else
                                {
                                    List <ArtifactData> artifactsByArtifactId = MonoSingleton <GameManager> .Instance.Player.FindArtifactsByArtifactID(history.artifact.iname);

                                    if (artifactsByArtifactId != null && artifactsByArtifactId.Count > 0)
                                    {
                                        artifactsByArtifactId.RemoveAt(0);
                                        dictionary.Add(history.artifact.iname, artifactsByArtifactId);
                                        isnew = artifactsByArtifactId.Count <= 0;
                                    }
                                }
                                NewBadgeParam data = new NewBadgeParam(true, isnew, NewBadgeType.Artifact);
                                DataSource.Bind <NewBadgeParam>(gameObject, data);
                                this.mItems.Add(gameObject);
                                gameObject.get_transform().SetAsFirstSibling();
                            }
                        }
                    }
                }
                if (Object.op_Inequality((Object)this.TitleText, (Object)null))
                {
                    Text component = (Text)this.TitleText.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        string str = LocalizedText.Get("sys.TEXT_GACHA_HISTORY_FOOTER", (object)dataOfClass.GetDropAt().ToString("yyyy/MM/dd HH:mm:ss"), (object)dataOfClass.gachaTitle);
                        component.set_text(str);
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }
        private void Initalize()
        {
            GachaHistoryItemData dataOfClass = DataSource.FindDataOfClass <GachaHistoryItemData>(((Component)this).get_gameObject(), (GachaHistoryItemData)null);

            if (dataOfClass == null)
            {
                DebugUtility.LogError("履歴が存在しません");
            }
            else
            {
                for (int index = dataOfClass.historys.Length - 1; index >= 0; --index)
                {
                    GachaHistoryData history = dataOfClass.historys[index];
                    if (history != null)
                    {
                        GameObject gameObject1 = (GameObject)null;
                        bool       flag        = false;
                        if (history.type == GachaDropData.Type.Unit)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.UnitIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <UnitData>(gameObject1, GachaHistoryWindow.CreateUnitData(history.unit));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Item)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <ItemData>(gameObject1, GachaHistoryWindow.CreateItemData(history.item, history.num));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.Artifact)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                DataSource.Bind <ArtifactData>(gameObject1, GachaHistoryWindow.CreateArtifactData(history.artifact, history.rarity));
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        else if (history.type == GachaDropData.Type.ConceptCard)
                        {
                            gameObject1 = (GameObject)Object.Instantiate <GameObject>((M0)this.ConceptCardIconObj);
                            if (Object.op_Inequality((Object)gameObject1, (Object)null))
                            {
                                gameObject1.get_transform().SetParent(this.ListParent, false);
                                gameObject1.SetActive(true);
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(history.conceptcard.iname);
                                ConceptCardIcon component          = (ConceptCardIcon)gameObject1.GetComponent <ConceptCardIcon>();
                                if (Object.op_Inequality((Object)component, (Object)null))
                                {
                                    component.Setup(cardDataForDisplay);
                                }
                                flag = history.isNew;
                                this.mItems.Add(gameObject1);
                                gameObject1.get_transform().SetAsFirstSibling();
                            }
                        }
                        if (Object.op_Inequality((Object)gameObject1, (Object)null))
                        {
                            SerializeValueBehaviour component = (SerializeValueBehaviour)gameObject1.GetComponent <SerializeValueBehaviour>();
                            if (Object.op_Inequality((Object)component, (Object)null))
                            {
                                GameObject gameObject2 = component.list.GetGameObject("new");
                                if (Object.op_Inequality((Object)gameObject2, (Object)null))
                                {
                                    gameObject2.SetActive(flag);
                                }
                            }
                        }
                    }
                }
                if (Object.op_Inequality((Object)this.TitleText, (Object)null))
                {
                    Text component = (Text)this.TitleText.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        string str = LocalizedText.Get("sys.TEXT_GACHA_HISTORY_FOOTER", (object)dataOfClass.GetDropAt().ToString("yyyy/MM/dd HH:mm:ss"), (object)dataOfClass.gachaTitle);
                        component.set_text(str);
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }