Beispiel #1
0
        public void ClickOpenContainerButton(ButtonClickEvent e, SingleNode <SpecialOfferOpenContainerButton> button, [JoinAll] SingleNode <BattleResultsAwardsScreenComponent> screen)
        {
            Entity entity = Flow.Current.EntityRegistry.GetEntity(button.component.containerId);

            BattleResultAwardsScreenSystem.GamePlayChestItemNode node = base.Select <BattleResultAwardsScreenSystem.GamePlayChestItemNode>(entity, typeof(MarketItemGroupComponent)).FirstOrDefault <BattleResultAwardsScreenSystem.GamePlayChestItemNode>();
            if ((node != null) && (node.userItemCounter.Count != 0L))
            {
                OpenContainerEvent eventInstance = new OpenContainerEvent {
                    Amount = button.component.quantity
                };
                base.ScheduleEvent(eventInstance, node);
                button.component.onOpen();
            }
        }
Beispiel #2
0
        public void OpenGameplayChest(ButtonClickEvent e, SingleNode <OpenGameplayChestButtonComponent> button, [JoinAll] UserNode user, [JoinByLeague] LeagueNode league, [JoinAll] ScreenNode screen)
        {
            screen.battleResultsAwardsScreen.openChestButton.SetActive(false);
            Entity entity = Flow.Current.EntityRegistry.GetEntity(league.chestBattleReward.ChestId);
            GamePlayChestItemNode node = base.Select <GamePlayChestItemNode>(entity, typeof(MarketItemGroupComponent)).FirstOrDefault <GamePlayChestItemNode>();

            if ((node != null) && (node.userItemCounter.Count != 0L))
            {
                OpenContainerEvent eventInstance = new OpenContainerEvent {
                    Amount = node.userItemCounter.Count
                };
                base.ScheduleEvent(eventInstance, node);
            }
        }