IEnumerator Playing() { EventSystemController.OffEventSystemForSeconds(5); var service = Services.GetService <IPrizeWheelGameService>(); if (service.HasTries) { service.RemoveTries(1); } _Game.SetupGame(); _Game.StartRound(); yield break; }
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)); }); }
private void Awake() { Instance = this; }