public void OnClick() { GameEvents.Involve_OnEndTurnButtonClicked(); _buttonPanel.SetEndTurnButton(false); if (!GameCore.CanStillWinTheGame()) { Debug.Log("Game Over!"); FadeItAll.FadeSceneChange("GameOverScene", Color.black, 3f); } }
public override IEnumerator FadeIt() { while (!Start) { yield return(null); } LastTime = Time.time; float coDelta = LastTime; bool hasFaded = false; while (!hasFaded) { coDelta = Time.time - LastTime; if (IsFadeIn) { MyAlpha = NewAlpha(coDelta, 1, MyAlpha); if (MyAlpha == 1) { hasFaded = true; MyCanvas.interactable = true; } } else { MyAlpha = NewAlpha(coDelta, 0, MyCanvas.alpha); if (MyAlpha == 0) { hasFaded = true; MyCanvas.interactable = false; } } LastTime = Time.time; MyCanvas.alpha = MyAlpha; yield return(null); } FadeItAll.DoneFading(); Destroy(gameObject); yield return(null); }
public void SetEndTurnButton(bool boolean) { if (!boolean) { FadeItAll.FadeCanvasGroup(_canvas, 3, false); _isFadedIn = false; return; } if (_isFadedIn) { return; } FadeItAll.FadeCanvasGroup(_canvas, 3, true); _isFadedIn = true; }
public override IEnumerator FadeIt() { while (!Start) { yield return(null); } LastTime = Time.time; float coDelta = LastTime; bool hasFaded = false; while (!hasFaded) { coDelta = Time.time - LastTime; if (IsFadeIn) { MyVolume = NewVolume(coDelta, 1, MyVolume); if (MyVolume == 1) { hasFaded = true; } } else { MyVolume = NewVolume(coDelta, 0, MyAudioSource.volume); if (MyVolume == 0) { hasFaded = true; } } LastTime = Time.time; MyAudioSource.volume = MyVolume; yield return(null); } FadeItAll.DoneFading(); Destroy(gameObject); yield return(null); }
public void OnClicked() { FadeItAll.FadeAudio(backGroundMusicSource, 1, false); if (transform.name == "1Player") { GameCore.numberOfHandCards = 8; FadeItAll.FadeSceneChange("gameScene", Color.black, 1f); GameCore.numberOfPlayers = 1; } else { GameCore.numberOfHandCards = 7; GameCore.numberOfPlayers = 2; FadeItAll.FadeSceneChange("gameScene", Color.black, 1f); } }
public override IEnumerator FadeIt() { while (!Start) { yield return(null); } LastTime = Time.time; float coDelta = LastTime; bool hasFadedIn = false; while (!hasFadedIn) { coDelta = Time.time - LastTime; if (!IsFadeIn) { Alpha = newAlpha(coDelta, 1, Alpha); if (Alpha == 1 && !StartedLoading) { StartedLoading = true; SceneManager.LoadScene(FadeScene); } } else { Alpha = newAlpha(coDelta, 0, Alpha); if (Alpha == 0) { hasFadedIn = true; } } LastTime = Time.time; MyCanvas.alpha = Alpha; yield return(null); } FadeItAll.DoneFading(); Destroy(gameObject); yield return(null); }
public void CheckIfGameOver(CardBase droppedCard, int numberOfCardsInHand) { int numberOfCardsLeft = drawnNumbers.Count; //check if game won if (numberOfCardsInHand == 0 && numberOfCardsLeft == 0) { Debug.Log("Game Won!"); lostTheGame = false; FadeItAll.FadeSceneChange("GameOverScene", Color.black, 3f); } // check if game lost else if (cardsDropped == 1 && !CanStillWinTheGame()) { Debug.Log("Game Over!"); // SceneManager.LoadScene("GameOverScene"); FadeItAll.FadeSceneChange("GameOverScene", Color.black, 3f); } }
private void SetChoiceButtons(bool value) { cardHandler.EnableAllHandCards(false); validationButton.transform.gameObject.SetActive(true); declineButton.transform.gameObject.SetActive(true); if (value) { FadeItAll.FadeCanvasGroup(validationButton.GetComponent <CanvasGroup>(), 3, true); FadeItAll.FadeCanvasGroup(declineButton.GetComponent <CanvasGroup>(), 3, true); validationButton.onClick.AddListener(OnValidationClicked); declineButton.onClick.AddListener(OnDeclineClicked); } else { FadeItAll.FadeCanvasGroup(validationButton.GetComponent <CanvasGroup>(), 3, false); FadeItAll.FadeCanvasGroup(declineButton.GetComponent <CanvasGroup>(), 3, false); validationButton.onClick.RemoveListener(OnValidationClicked); declineButton.onClick.RemoveListener(OnDeclineClicked); } }
private void OnCardDroppedInSlot(CardBase droppedCard, int numberOfCardsInHand) { _canvas.interactable = false; _isFadedIn = false; FadeItAll.FadeCanvasGroup(_canvas, 3f, false); }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // //} public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { // GameCore.numberOfHandCards = 8; // SceneManager.LoadScene("gameScene"); FadeItAll.FadeSceneChange("gameScene", Color.black, 3f); }
void Start() { FadeItAll.FadeAudio(myAudioSource, 1, true); }
public void TriggerMusic() { FadeItAll.FadeAudio(myAudioSource, 3, false); }
public void LoadMainMenu() { FadeItAll.FadeSceneChange("MainMenuScene", Color.black, 5f); }