Esempio n. 1
0
 protected override void Start()
 {
     this.ClickTrigger = (PointerClickTrigger)((Component)this._raycastTarget).get_gameObject().AddComponent <PointerClickTrigger>();
     ((Behaviour)this.ClickTrigger).set_enabled(false);
     UITrigger.TriggerEvent triggerEvent = new UITrigger.TriggerEvent();
     // ISSUE: method pointer
     ((UnityEvent <BaseEventData>)triggerEvent).AddListener(new UnityAction <BaseEventData>((object)this, __methodptr(\u003CStart\u003Em__0)));
     ((UITrigger)this.ClickTrigger).get_Triggers().Add(triggerEvent);
     ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(x => this.SetActiveControl(x)));
     base.Start();
     ((Component)this).get_gameObject().SetActive(false);
 }
Esempio n. 2
0
        private void Start()
        {
            PointerClickTrigger pointerClickTrigger = (PointerClickTrigger)((Component)this._canvasGroup).get_gameObject().AddComponent <PointerClickTrigger>();

            UITrigger.TriggerEvent triggerEvent = new UITrigger.TriggerEvent();
            // ISSUE: method pointer
            ((UnityEvent <BaseEventData>)triggerEvent).AddListener(new UnityAction <BaseEventData>((object)this, __methodptr(\u003CStart\u003Em__2)));
            ((UITrigger)pointerClickTrigger).get_Triggers().Add(triggerEvent);
            // ISSUE: method pointer
            ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__3)));
            // ISSUE: method pointer
            this._itemList.OnSubmit.AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__4)));
            // ISSUE: method pointer
            this._itemList.OnCancel.AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__5)));
        }
    public void ItemRemove()
    {
        this.canUse = true;
        this.lstHItem.Clear();
        this.hitemInfos.Clear();
        this.nodes.Clear();
        List <GameObject> list = this.hSceneNodePool.GetList();

        for (int index = 0; index < list.Count; ++index)
        {
            if (list[index].get_gameObject().get_activeSelf())
            {
                ((HItemNode)list[index].GetComponent <HItemNode>()).ScaleSet.SetActive(false);
                list[index].get_gameObject().SetActive(false);
            }
        }
        this.CheckHadItem(3, ref this.hitemInfos);
        this.CheckHadItem(5, ref this.hitemInfos);
        this.CheckHadItem(6, ref this.hitemInfos);
        this.CheckHadItem(7, ref this.hitemInfos);
        for (int index1 = 0; index1 < this.hitemInfos.Count; ++index1)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            HSceneSpriteHitem.\u003CItemRemove\u003Ec__AnonStorey2 removeCAnonStorey2 = new HSceneSpriteHitem.\u003CItemRemove\u003Ec__AnonStorey2();
            // ISSUE: reference to a compiler-generated field
            removeCAnonStorey2.\u0024this = this;
            // ISSUE: reference to a compiler-generated field
            removeCAnonStorey2.no = index1;
            this.hSceneNodePool.Get(0);
            // ISSUE: reference to a compiler-generated field
            this.tmpNode = (HItemNode)this.pool[removeCAnonStorey2.no].GetComponent <HItemNode>();
            // ISSUE: reference to a compiler-generated field
            this.tmpNode.text.set_text(this.hitemInfos[removeCAnonStorey2.no].ItemName);
            // ISSUE: reference to a compiler-generated field
            int num = this.CheckHadItemNum(this.hitemInfos[removeCAnonStorey2.no].id);
            if (num > 999)
            {
                this.tmpNode.NumTxt.set_text("999+");
            }
            else
            {
                this.tmpNode.NumTxt.set_text(string.Format("{0}", (object)num));
            }
            this.tmpNode.ScaleSet.SetActive(true);
            this.toggle  = this.tmpNode.Toggle;
            this.onClick = new UITrigger.TriggerEvent();
            if (Object.op_Inequality((Object)this.toggle, (Object)null))
            {
                this.images = (Image[])((Component)this.toggle).GetComponentsInChildren <Image>();
                this.PointerClickTrigger = (PointerClickTrigger)((Component)this.toggle).GetComponent <PointerClickTrigger>();
                if (Object.op_Equality((Object)this.PointerClickTrigger, (Object)null))
                {
                    this.PointerClickTrigger = (PointerClickTrigger)((Component)this.toggle).get_gameObject().AddComponent <PointerClickTrigger>();
                }
                ((UITrigger)this.PointerClickTrigger).get_Triggers().Clear();
                ((UITrigger)this.PointerClickTrigger).get_Triggers().Add(this.onClick);
                // ISSUE: method pointer
                ((UnityEvent <BaseEventData>) this.onClick).AddListener(new UnityAction <BaseEventData>((object)removeCAnonStorey2, __methodptr(\u003C\u003Em__0)));
                if (((Selectable)this.toggle).get_interactable())
                {
                    ((Selectable)this.toggle).set_interactable(false);
                }
                for (int index2 = 0; index2 < this.images.Length; ++index2)
                {
                    if (((Object)((Component)this.images[index2]).get_transform()).get_name() == "ItemIcon")
                    {
                        // ISSUE: reference to a compiler-generated field
                        Resources.ItemIconTables.SetIcon(Resources.ItemIconTables.IconCategory.Item, this.hitemInfos[removeCAnonStorey2.no].iconId, this.images[index2], false);
                        if (Object.op_Inequality((Object)this.images[index2].get_sprite(), (Object)null))
                        {
                            ((Behaviour)this.images[index2]).set_enabled(true);
                        }
                    }
                    if (!((Graphic)this.images[index2]).get_raycastTarget())
                    {
                        ((Graphic)this.images[index2]).set_raycastTarget(true);
                    }
                }
            }
            this.nodes.Add((ScrollCylinderNode)this.tmpNode);
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            this.lstHItem.Add(this.hitemInfos[removeCAnonStorey2.no].id, new ValueTuple <int, HSceneSpriteHitem.HitemInfo>(removeCAnonStorey2.no, this.hitemInfos[removeCAnonStorey2.no]));
            // ISSUE: reference to a compiler-generated field
            this.pool[removeCAnonStorey2.no].SetActive(true);
        }
        if (this.lstHItem.Count == 0)
        {
            this.canUse = false;
            this.hSceneNodePool.Get(0);
            this.lstHItem.Add(-1, new ValueTuple <int, HSceneSpriteHitem.HitemInfo>(-1, new HSceneSpriteHitem.HitemInfo()));
            this.toggle = (Toggle)this.pool[0].GetComponent <Toggle>();
            this.PointerClickTrigger = (PointerClickTrigger)this.pool[0].GetComponent <PointerClickTrigger>();
            ((UITrigger)this.PointerClickTrigger).get_Triggers().Clear();
            if (Object.op_Inequality((Object)this.toggle, (Object)null))
            {
                if (((Selectable)this.toggle).get_interactable())
                {
                    ((Selectable)this.toggle).set_interactable(false);
                }
                this.images = (Image[])((Component)this.toggle).GetComponentsInChildren <Image>();
                for (int index = 0; index < this.images.Length; ++index)
                {
                    if (((Object)((Component)this.images[index]).get_transform()).get_name() == "ItemIcon")
                    {
                        ((Behaviour)this.images[index]).set_enabled(false);
                    }
                    if (((Graphic)this.images[index]).get_raycastTarget())
                    {
                        ((Graphic)this.images[index]).set_raycastTarget(false);
                    }
                }
            }
            this.tmpNode = (HItemNode)this.pool[0].GetComponent <HItemNode>();
            this.tmpNode.text.set_text(string.Empty);
            this.nodes.Add((ScrollCylinderNode)this.tmpNode);
        }
        ObservableExtensions.Subscribe <Unit>((IObservable <M0>)Observable.NextFrame((FrameCountType)0), (Action <M0>)(_ =>
        {
            this.hSceneScroll.ListNodeSet(this.nodes);
            if (this.canUse)
            {
                int itemId = this.ConvertScrollIDToItemID((int)this.hSceneScroll.GetTarget().Item1);
                if (!this.lstHItem.ContainsKey(itemId))
                {
                    return;
                }
                // ISSUE: cast to a reference type
                // ISSUE: explicit reference operation
                this.ExplanatoryText.set_text((^ (HSceneSpriteHitem.HitemInfo &) ref this.lstHItem[itemId].Item2).ExplanatoryText);
            }
            else
            {
                this.ExplanatoryText.set_text("Hアイテムを所持していません");
            }
        }));
    }