Ejemplo n.º 1
0
    IEnumerator Playing()
    {
        EventSystemController.OffEventSystemForSeconds(5);
        var service = Services.GetService <IPrizeWheelGameService>();

        if (service.HasTries)
        {
            service.RemoveTries(1);
        }

        _Game.SetupGame();
        _Game.StartRound();
        yield break;
    }
Ejemplo n.º 2
0
        public void Play(TreasureHuntChestView chest)
        {
            if (!_canPlay || !Services.TreasureHuntService.HasTries)
            {
                return;
            }

            _canPlay = false;
            chest.ChestButton.interactable = false;
            EventSystemController.OffEventSystemForSeconds(2f);

            TreasureHuntGameController.OpenChest(chest, () =>
            {
                _canPlay = true;
                Services.TreasureHuntService.RemoveTries(1);
                chest.ChestButton.interactable = false;
                if (!TreasureHuntGameController.HasAnyReward())
                {
                    Services.TreasureHuntService.RemoveTries(Services.TreasureHuntService.TriesCount);
                }
                GameEvents.OnTutorialEvent(new TutorialEventData(TutorialEventName.ChestOpened));
            });
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     Instance = this;
 }