Ejemplo n.º 1
0
        private void OnSelectIcon(int index, GachaResultThumbnailWindow.GachaResultType type)
        {
            FlowNode_Variable.Set("GachaResultDataIndex", index.ToString());
            FlowNode_Variable.Set("GachaResultCurrentDetail", type.ToString());
            int pinID = 0;

            switch (type)
            {
            case GachaResultThumbnailWindow.GachaResultType.Unit:
                pinID = !this.CheckSingleDropForUnit() ? this.OUT_UNITDETAIL : this.OUT_UNITDETAIL_SINGLE;
                break;

            case GachaResultThumbnailWindow.GachaResultType.Item:
                pinID = this.OUT_ITEM_DETAIL;
                break;

            case GachaResultThumbnailWindow.GachaResultType.Piece:
                pinID = this.OUT_PIECE_DETAIL;
                break;

            case GachaResultThumbnailWindow.GachaResultType.Artifact:
                pinID = this.OUT_ARTIFACT_DETAIL;
                break;
            }
            FlowNode_GameObject.ActivateOutputLinks((Component)this, pinID);
        }
        private void OnSelectIcon(int index, GachaResultThumbnailWindow.GachaResultType type)
        {
            FlowNode_Variable.Set("GachaResultDataIndex", index.ToString());
            FlowNode_Variable.Set("GachaResultCurrentDetail", type.ToString());
            switch (type)
            {
            case GachaResultThumbnailWindow.GachaResultType.Unit:
                FlowNode_GameObject.ActivateOutputLinks((Component)this, this.OUT_UNIT_DETAIL);
                break;

            case GachaResultThumbnailWindow.GachaResultType.Item:
                FlowNode_GameObject.ActivateOutputLinks((Component)this, this.OUT_ITEM_DETAIL);
                break;

            case GachaResultThumbnailWindow.GachaResultType.Piece:
                FlowNode_GameObject.ActivateOutputLinks((Component)this, this.OUT_PIECE_DETAIL);
                break;

            case GachaResultThumbnailWindow.GachaResultType.Artifact:
                FlowNode_GameObject.ActivateOutputLinks((Component)this, this.OUT_ARTIFACT_DETAIL);
                break;
            }
        }
        private void RefreshResult(GachaDropData[] _drops, GameObject _block, int _block_type, bool _is_anim = false)
        {
            if (_drops == null || _drops.Length < 0 || UnityEngine.Object.op_Equality((UnityEngine.Object)_block, (UnityEngine.Object)null))
            {
                return;
            }
            _block.SetActive(true);
            int length = _drops.Length;
            SerializeValueBehaviour component1 = (SerializeValueBehaviour)_block.GetComponent <SerializeValueBehaviour>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                GameObject gameObject1 = component1.list.GetGameObject("icon");
                gameObject1.SetActive(false);
                for (int index1 = 0; index1 < length; ++index1)
                {
                    GachaDropData drop = _drops[index1];
                    int           num  = index1;
                    GachaResultThumbnailWindow.GachaResultType gachaResultType = GachaResultThumbnailWindow.GachaResultType.None;
                    if (drop != null)
                    {
                        GameObject gameObject2 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)gameObject1);
                        gameObject2.get_transform().SetParent(gameObject1.get_transform().get_parent(), false);
                        ((Behaviour)gameObject2.GetComponent <Animator>()).set_enabled(_is_anim);
                        SerializeValueBehaviour component2 = (SerializeValueBehaviour)gameObject2.GetComponent <SerializeValueBehaviour>();
                        if (!UnityEngine.Object.op_Equality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                        {
                            GameObject gameObject3 = (GameObject)null;
                            if (drop.type == GachaDropData.Type.Unit)
                            {
                                gameObject3 = component2.list.GetGameObject("unit");
                                DataSource.Bind <UnitData>(gameObject3, this.CreateUnitData(drop.unit));
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.Unit;
                            }
                            else if (drop.type == GachaDropData.Type.Item)
                            {
                                gameObject3 = component2.list.GetGameObject("item");
                                DataSource.Bind <ItemData>(gameObject3, this.CreateItemData(drop.item, drop.num));
                                ItemIcon component3 = (ItemIcon)gameObject3.GetComponent <ItemIcon>();
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null))
                                {
                                    component3.UpdateValue();
                                }
                                gachaResultType = !string.IsNullOrEmpty(drop.item.Flavor) ? GachaResultThumbnailWindow.GachaResultType.Item : GachaResultThumbnailWindow.GachaResultType.Piece;
                            }
                            else if (drop.type == GachaDropData.Type.Artifact)
                            {
                                gameObject3 = component2.list.GetGameObject("artifact");
                                DataSource.Bind <ArtifactData>(gameObject3, this.CreateArtifactData(drop.artifact, drop.Rare));
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.Artifact;
                            }
                            else if (drop.type == GachaDropData.Type.ConceptCard)
                            {
                                gameObject3 = component2.list.GetGameObject("conceptcard");
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(drop.conceptcard.iname);
                                ConceptCardIcon component3         = (ConceptCardIcon)gameObject3.GetComponent <ConceptCardIcon>();
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null))
                                {
                                    component3.Setup(cardDataForDisplay);
                                    SerializeValueBehaviour component4 = (SerializeValueBehaviour)gameObject3.GetComponent <SerializeValueBehaviour>();
                                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component4, (UnityEngine.Object)null))
                                    {
                                        GameObject gameObject4 = component4.list.GetGameObject("unit_icon");
                                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject4, (UnityEngine.Object)null))
                                        {
                                            UnitData data = (UnitData)null;
                                            if (drop.cardunit != null)
                                            {
                                                data = this.CreateUnitData(drop.cardunit);
                                            }
                                            DataSource.Bind <UnitData>(gameObject4, data);
                                            gameObject4.SetActive(drop.cardunit != null);
                                        }
                                        GameObject gameObject5 = component4.list.GetGameObject("skin");
                                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject5, (UnityEngine.Object)null))
                                        {
                                            bool flag = false;
                                            if (drop.conceptcard.effects != null && drop.conceptcard.effects.Length > 0)
                                            {
                                                for (int index2 = 0; index2 < drop.conceptcard.effects.Length; ++index2)
                                                {
                                                    ConceptCardEffectsParam effect = drop.conceptcard.effects[index2];
                                                    if (effect != null && !string.IsNullOrEmpty(effect.skin))
                                                    {
                                                        flag = true;
                                                        break;
                                                    }
                                                }
                                            }
                                            gameObject5.SetActive(flag);
                                        }
                                    }
                                }
                                gachaResultType = GachaResultThumbnailWindow.GachaResultType.ConceptCard;
                            }
                            if (UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject3, (UnityEngine.Object)null))
                            {
                                DebugUtility.LogError("アイコンオブジェクトがありません");
                                break;
                            }
                            SerializeValueBehaviour component5 = (SerializeValueBehaviour)gameObject3.GetComponent <SerializeValueBehaviour>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component5, (UnityEngine.Object)null))
                            {
                                GameObject gameObject4 = component5.list.GetGameObject("new");
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component5, (UnityEngine.Object)null))
                                {
                                    gameObject4.SetActive(drop.isNew);
                                }
                            }
                            ButtonEvent component6 = (ButtonEvent)gameObject3.GetComponent <ButtonEvent>();
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component6, (UnityEngine.Object)null))
                            {
                                ButtonEvent.Event @event = component6.GetEvent("CLICK_ICON");
                                if (@event != null)
                                {
                                    @event.valueList.SetField("index", num);
                                    @event.valueList.SetField("type", (int)gachaResultType);
                                    @event.valueList.SetField("block", _block_type);
                                    if (gachaResultType == GachaResultThumbnailWindow.GachaResultType.ConceptCard)
                                    {
                                        @event.valueList.SetField("is_first_get_unit", drop.cardunit != null);
                                    }
                                }
                            }
                            gameObject3.SetActive(true);
                            this.m_ResultIconRootList.Add(gameObject2);
                            if (_block_type == 0)
                            {
                                this.m_ResultIconRootList.Add(gameObject2);
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                }
            }
            SerializeValueBehaviour component7 = (SerializeValueBehaviour)((Component)this).get_gameObject().GetComponent <SerializeValueBehaviour>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component7, (UnityEngine.Object)null))
            {
                return;
            }
            GameObject gameObject = component7.list.GetGameObject("space");

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
            {
                return;
            }
            gameObject.get_transform().SetAsLastSibling();
            gameObject.SetActive(length > GachaResultThumbnailWindow.VIEW_COUNT);
        }