コード例 #1
0
        private void OnScrollerChange(Transform trans, int index)
        {
            MonoLevelDropIconButtonBox component = trans.GetComponent <MonoLevelDropIconButtonBox>();
            MonoLevelDropIconButton    button    = trans.Find("Item").GetComponent <MonoLevelDropIconButton>();
            Vector2 cellSize = this._dropScroller.grid.GetComponent <GridLayoutGroup>().cellSize;

            trans.SetLocalScaleX(cellSize.x / button.width);
            trans.SetLocalScaleY(cellSize.y / button.height);
            DropItem            item = this._dropItemList[index];
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), 1);

            dummyStorageDataItem.level  = (int)item.get_level();
            dummyStorageDataItem.number = (int)item.get_num();
            button.SetupView(dummyStorageDataItem, new DropItemButtonClickCallBack(this.OnDropItemBtnClick), true, true, false, false);
            if (item == this._normalDropItem)
            {
                component.SetupTypeView(MonoLevelDropIconButtonBox.Type.NormalFinishChallengeReward, this._dropPanelBGAniamtionEnd);
            }
            else if (item == this._fastDropItem)
            {
                component.SetupTypeView(MonoLevelDropIconButtonBox.Type.FastFinishChallengeReward, this._dropPanelBGAniamtionEnd);
            }
            else if (item == this._sonicDropItem)
            {
                component.SetupTypeView(MonoLevelDropIconButtonBox.Type.SonicFinishChallengeReward, this._dropPanelBGAniamtionEnd);
            }
            else
            {
                component.SetupTypeView(MonoLevelDropIconButtonBox.Type.DefaultDrop, this._dropPanelBGAniamtionEnd);
            }
        }
コード例 #2
0
        private void OnScrollerChange(Transform trans, int index)
        {
            Vector2 cellSize = this._dropScroller.grid.GetComponent <GridLayoutGroup>().cellSize;

            trans.SetLocalScaleX(cellSize.x / trans.GetComponent <MonoLevelDropIconButton>().width);
            trans.SetLocalScaleY(cellSize.y / trans.GetComponent <MonoLevelDropIconButton>().height);
            DropItem            item = this._dropItemList[index];
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), 1);

            dummyStorageDataItem.level  = (int)item.get_level();
            dummyStorageDataItem.number = (int)item.get_num();
            trans.GetComponent <MonoLevelDropIconButton>().SetupView(dummyStorageDataItem, null, true, true, false, false);
            trans.GetComponent <MonoAnimationinSequence>().animationName = "DropItemScale07";
        }
コード例 #3
0
        private void OnScrollerChange(Transform trans, int index)
        {
            Vector2 cellSize = this._dropGridScroller.grid.GetComponent <GridLayoutGroup>().cellSize;

            trans.SetLocalScaleX(0.85f);
            trans.SetLocalScaleY(0.85f);
            DropItem            item = this._dropItemList[index];
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), 1);

            dummyStorageDataItem.level  = (int)item.get_level();
            dummyStorageDataItem.number = (int)item.get_num();
            trans.GetComponent <CanvasGroup>().alpha = 1f;
            trans.GetComponent <MonoLevelDropIconButton>().SetupView(dummyStorageDataItem, null, true, false, false, false);
        }