void Start() { for (int i = 0; i < theTeamImagesA.Count; i++) { theTeamImagesA[i].gameObject.SetActive(false); } for (int i = 0; i < theTeamImagesB.Count; i++) { theTeamImagesB[i].gameObject.SetActive(false); } for (int i = 0; i < titleText.Count; i++) { titleText[i].gameObject.SetActive(false); } StartCoroutine(GenericFunctions.FadeOutImage(.5f, fadeImage, 0f)); StartCoroutine(GenericFunctions.FadeInSound(.5f, audioSource, 1f, .5f)); StartCoroutine(GenericFunctions.FadeInImage(1.25f, imageGGJ, delay)); StartCoroutine(GenericFunctions.FadeOutImage(1.25f, imageGGJ, delay + 2.5f)); StartCoroutine(GenericFunctions.FadeInImage(3f, imageGGJ, delay + 42f)); StartCoroutine(GenericFunctions.ThisFunctionIsOnlyForGGJ(1f, titleText[0], theTeamA, delay + 5, 3f, 9f)); StartCoroutine(GenericFunctions.ThisFunctionIsOnlyForGGJ(1f, titleText[1], theRolesA, delay + 5, 3f, 9f)); StartCoroutine(GenericFunctions.SuperFadeInImage(1f, theTeamImagesA, delay + 5, 3f, 9f)); StartCoroutine(GenericFunctions.ThisFunctionIsOnlyForGGJ(1f, titleText[2], theTeamB, delay + 12f, 3f, 9f)); StartCoroutine(GenericFunctions.ThisFunctionIsOnlyForGGJ(1f, titleText[3], theRolesB, delay + 12f, 3f, 9f)); StartCoroutine(GenericFunctions.SuperFadeInImage(1f, theTeamImagesB, delay + 12f, 3f, 9f)); }
private void SelectMenuButton() { buttonsEnabled = false; audioSource.PlayOneShot(clipSelect); StartCoroutine(GenericFunctions.FadeOutSound(.75f, audioSource, 0f)); switch (buttonIndex) { case 0: StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "CharacterSelection")); break; case 1: StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "Credits")); break; case 2: Debug.Log("Exit Game"); StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "")); break; default: Debug.Log("MainMenuManager: error en SelectMenuButton"); break; } }
private void Finish(string playerID) { var victory = playerID == Constants.PLAYER_1_TAG ? "2" : "1"; this.victoryText.gameObject.SetActive(true); this.victoryText.text = $"victoria player {victory}"; StartCoroutine(GenericFunctions.FadeInImage(2.5f, fadeImage, "MainMenu")); }
// Update is called once per frame private void Update() { if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.ESCAPE)) { StartCoroutine(GenericFunctions.FadeOutSound(.75f, audioSource, 0f)); StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "MainMenu")); } if (player1selected && player2selected) { if (!fading) { StartCoroutine(GenericFunctions.FadeInImage(1.5f, fadeImage, "Stage1")); fading = true; } return; } timer -= Time.deltaTime; if (timer < 0) { SelectCharacterPlayer1(); SelectCharacterPlayer2(); } timerText.text = ((int)timer).ToString(); if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.LEFTH) && !player1selected) { PreviousCharacterPlayer1(); } if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.RIGHT) && !player1selected) { NextCharacterPlayer1(); } if (PlayerInputs.GetKeyDown(Constants.PLAYER_2_TAG, Constants.LEFTH) && !player2selected) { PreviousCharacterPlayer2(); } if (PlayerInputs.GetKeyDown(Constants.PLAYER_2_TAG, Constants.RIGHT) && !player2selected) { NextCharacterPlayer2(); } if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.SELECT) && !player1selected) { SelectCharacterPlayer1(); } if (PlayerInputs.GetKeyDown(Constants.PLAYER_2_TAG, Constants.SELECT) && !player2selected) { SelectCharacterPlayer2(); } }
// Update is called once per frame void Update() { if (PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.ESCAPE) || PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.SELECT) || PlayerInputs.GetKeyDown(Constants.PLAYER_1_TAG, Constants.ATTACK)) { audioSource.PlayOneShot(clipSelect); StartCoroutine(GenericFunctions.FadeOutSound(.75f, audioSource, 0f)); StartCoroutine(GenericFunctions.FadeInImage(.75f, fadeImage, "MainMenu")); buttonsEnabled = false; } }
void Start() { StartCoroutine(GenericFunctions.FadeOutImage(.5f, fadeImage, 1f)); //Invoke("EnableMenuButtons", delay + 3); for (int i = 0; i < animations.Count; i++) { animations[i].gameObject.SetActive(false); } StartCoroutine(PlayMainMenuAnimation(animations[0], delay + 1.5f)); StartCoroutine(PlayMainMenuAnimation(animations[1], delay + 2.25f)); StartCoroutine(PlayMainMenuAnimation(animations[2], delay + 3.25f)); StartCoroutine(PlayMainMenuAnimation(animations[3], delay + 3.50f)); StartCoroutine(PlayMainMenuAnimation(animations[4], delay + 3.75f)); audioSource.PlayDelayed(.3f); StartCoroutine(GenericFunctions.FadeInSound(.4f, audioSource, 1f, .5f)); StartCoroutine(GenericFunctions.FadeInImage(1.25f, imageGGJ, delay + 5f)); }