private void MinigameOnStateChanged(Minigame.MinigameState minigameState)
 {
     if (minigameState == StateToEnableOn)
     {
         ToEnableOnState.SetActive(enabledToSet);
     }
 }
        private void MinigameOnStateChanged(Minigame.MinigameState minigameState)
        {
            if (this == null || gameObject == null)
                return;

            if (minigameState == StateToDestroyOn && gameObject != null)
                Destroy(gameObject);
        }
        public void SetMinigame(Minigame minigamePrefab)
        {
            if (CurrentMinigame != null)
                return;

            SelectedMinigamePrefab = minigamePrefab;
            NextMinigame = minigamePrefab;
        }
 private void OnStateChanged(Minigame.MinigameState minigameState)
 {
     if (minigameState == Minigame.MinigameState.Running)
     {
         spriteRenderer.sprite = RunningSprite;
     }
     else if (minigameState == Minigame.MinigameState.Failed)
     {
         spriteRenderer.sprite = FailedSprite;
     }
     else if (minigameState == Minigame.MinigameState.Succeeded)
     {
         spriteRenderer.sprite = SuccessSprite;
     }
 }
        public void StartMinigame()
        {
            if (CurrentMinigame != null)
                return;

            previousMinigame = SelectedMinigamePrefab;

            var instance = Instantiate(SelectedMinigamePrefab.gameObject);
            CurrentMinigame = instance.GetComponent<Minigame>();
            NextMinigame = null;

            var info = new MinigameStartInfo
            {
                SpeedFactor = SpeedFactor,
                SecondsToComplete = CurrentMinigame.StartingSecondsToComplete / SpeedFactor
            };

            CurrentMinigame.StartMinigame(info);
        }