public void LoadCutscene12() { //WhiteFadeIn whitefader.FadeIn(0.5f); //LoadCustscene Invoke("LoadCutscene12afterwait", 0.5f); }
IEnumerator StartLevel() { blackOverlay.FadeIn(0.5f); HideMenuUI(); yield return(new WaitForSeconds(0.5f)); blackOverlay.FadeOut(0.5f); GameManager.instance.StartGame(selectedLevel); livesText.text = "LIVES: " + GameManager.instance.lives; }
public void Select() { StartCoroutine(UIFader.FadeIn(2)); FlashlightGO.SetActive(true); AnimationComp.Play(DrawAnim); isSelected = true; }
IEnumerator DisplayTimer() { uif.FadeIn(transitiontime); yield return(new WaitForSeconds(displayTime)); uif.FadeOut(transitiontime); }
private IEnumerator ReadAllDialogue() { while (startId >= 0) { nextDialogue = false; //We wait to make sure the proper dialogue is initialized LoadDialog(startId); m_TextMeshPro.text = ""; yield return(new WaitUntil(() => dialogueMustStart == true)); StartCoroutine("ReadLine"); yield return(new WaitUntil(() => nextDialogue == true)); } fader.FadeIn(0.5f); Invoke("OutOfSave", 0.5f); }
private void ShowError(string message) { error.text = message; error.enabled = true; UIFader.CancelCurrent(); UIFader.FadeIn(error, 0.1f); UIFader.FadeOut(error, 3.0f, 1.0f); }
IEnumerator BackToMenu() { blackOverlay.FadeIn(0.4f); yield return(new WaitForSeconds(0.4f)); livesText.text = ""; blackOverlay.FadeOut(0.4f); mainMenuParent.FadeIn(0.6f); logo.FadeIn(0); }
public void OnGameEnd(GameResult gr) { endgameMenuParent.FadeIn(0.3f); string title = ""; switch (gr) { case GameResult.win: title = "VICTORY"; break; case GameResult.lose: title = "GAME OVER"; break; } GameObject.Find("EndgameText").GetComponent <Text> ().text = title; }
private void FadePreference(bool _triger) { UIFader fader = preferenceWindow.GetComponent <UIFader>(); fader.OnOffRayCast(_triger); if (_triger) { fader.FadeIn(); } else { fader.FadeOut(); } }
private void ShowSelectedBlock(Block block) { string name = block.Name(); selectedText.text = name; UIFader.CancelCurrent(); UIFader.FadeIn(selectedPanel, 0.1f); UIFader.FadeIn(selectedText, 0.1f); UIFader.FadeOut(selectedPanel, 2.0f, 0.5f); UIFader.FadeOut(selectedText, 2.0f, 0.5f); }
private void FadeBackground(bool _triger) { UIFader background = root.GetComponent <UIFader>(); background.OnOffRayCast(_triger); if (_triger) { background.FadeIn(); } else { background.FadeOut(); } }
public IEnumerator ShowLevelsAndSettings() { mainMenuParent.FadeOut(0.3f); yield return(new WaitForSeconds(0.3f)); levelSelectParent.FadeIn(0.3f); GameManager.instance.LoadLevels(); int i = 0; Object[] levels = Object.FindObjectsOfType(typeof(LevelToggleInfo)); foreach (Object obj in levels) { LevelToggleInfo go = obj as LevelToggleInfo; if (go.gameObject.activeSelf) { Destroy(go.gameObject); } } foreach (Level l in GameManager.instance.levels) { GameObject go = Instantiate(levelToggle) as GameObject; go.SetActive(true); go.transform.SetParent(levelToggle.transform.parent, true); LayoutElement le = go.GetComponent <LayoutElement>(); le.preferredHeight = le.transform.parent.transform.parent.GetComponent <RectTransform> ().rect.height / 4; go.transform.Find("Padding/LevelName").GetComponent <Text>().text = l.name; Toggle t = go.GetComponent <Toggle>(); go.GetComponent <LevelToggleInfo>().id = i; t.onValueChanged.AddListener((v) => OnLevelChange()); if (i == 0) { go.GetComponent <Toggle>().isOn = true; } else { go.GetComponent <Toggle>().isOn = false; } i++; } selectedLevel = 0; //wait for 1 frame, cause Content Size Fitter wont work right away yield return(new WaitForSeconds(0.05f)); //scroll the list to the top Scrollbar scroll = GameObject.Find("LevelsScrollbar").GetComponent <Scrollbar> (); scroll.value = 1; }
public void OutOfSave(bool isNew = false) { //persistantHandler.GetComponent<InputHandler>().addObserver(this); if (isNew) { firstTimefade.FadeIn(2f); Invoke("LaunchCinematic", 2f); } else { this.GetComponentInParent <menuControllerScript>().StartMenuClose(); this.GetComponent <UIFader>().FadeOut(); _levelLoader.LoadNextLevel(-2); //We reload with the new selected save } }
private void LoadDialog(int _dialogueID) { //Plus tard on chargera un JSON string loadedJsonFile = Resources.Load <TextAsset>(ActualLanguage.actualLanguage.chosenLanguage.name).text; DialogueContainerOld dialoguesInJson = JsonUtility.FromJson <DialogueContainerOld>(loadedJsonFile); fader.FadeIn(0.3f); Invoke("afterFaded", 0.4f); int dialogueID = findDialogueByID(_dialogueID); startId = dialoguesInJson.dialogues[dialogueID].next; if (startId < 0) { waitForVideoToFinish = true; videoPlayer.isLooping = false; } videoValue = dialoguesInJson.dialogues[dialogueID].backgroundVideo; Character dialogueCharacter = new Character(); switch (dialoguesInJson.dialogues[dialogueID].character) { case "Ice": dialogueCharacter = dialogueCharacter.Ice(); break; case "Earth": dialogueCharacter = dialogueCharacter.Earth(); break; case "Death": dialogueCharacter = dialogueCharacter.Death(); break; case "Wizard": dialogueCharacter = dialogueCharacter.Wizard(); break; default: dialogueCharacter = dialogueCharacter.Fire(); break; } dialogue1 = new OldDialogue(dialogueCharacter, dialoguesInJson.dialogues[dialogueID].lines, 0); }
public void Select() { showSprite = true; isSelecting = true; LanternGO.SetActive(true); LanternLight.gameObject.SetActive(true); anim.Play(DrawAnim); if (audioS && ShowSound) { audioS.clip = ShowSound; audioS.volume = ShowVolume; audioS.Play(); } StartCoroutine(UIFader.FadeIn(2)); StartCoroutine(SelectCoroutine()); }
public void OutOfSave(bool isNew = false) { if (isNew) { firstTimefade.FadeIn(1f); GameObject.FindGameObjectsWithTag("MusicHandler")[0].GetComponent <handleMusicScript>().setVolume(0.3f, 2f); Debug.Log("Working "); InvokeRealTime("LaunchCinematic", 2f); } else { GameObject.FindGameObjectsWithTag("InputHandler")[0].GetComponent <InputHandler>().addObserver(this); inOption = false; passCinematic.doEnable(); //GoToStart(); UpdateProgress(); } }
async void WSReceiver() { WebSocketReceiveResult r = await cws.ReceiveAsync(buf, CancellationToken.None); res += Encoding.UTF8.GetString(buf.Array, 0, r.Count); // Debug.Log("GOT: " + Encoding.UTF8.GetString(buf.Array, 0, r.Count)); if (r.EndOfMessage) { Debug.Log("END: " + res); Debug.Log(state); if (state == "getArticles") { GenerateArticlesInfos(res); } else if (res.Substring(1, 9) == "_AVRSAYS:") { happyFace.SetActive(true); fader.FadeIn(balloon.gameObject.GetComponentInParent <CanvasGroup>()); balloon.textToSpeech = res.Substring(1, res.Length - 2).Remove(0, 9); StartCoroutine(Hide(false)); } else if (res.Substring(1, 9) == "_SESSION:") { HideFace(res.Substring(1, res.Length - 2).Remove(0, 9)); } else if (res.Substring(1, 9) == "_ARTICLE:") { qtInCart += 1; WSGetTotal(); } else if (res.Substring(2, 9) == "cartPrice") { cartPrice = res.Substring(14, 5); } res = ""; } WSReceiver(); }
public void FadeIn() { fader?.FadeIn(); }
public void FadeBlink(float time) { UIFader.SetBlinkTime(time); StartCoroutine(UIFader.FadeIn(FadeSpeed)); }
public void FadeIn() { UIFader.SetBlinkTime(0); StartCoroutine(UIFader.FadeIn(FadeSpeed)); }
public void ShowCanvas() { StartCoroutine(uiFader.FadeIn()); canvasGroup.interactable = true; }
IEnumerator DisplayConversation(Conversation convo) { // Initialize the conversation convo.Init(); // get the current dialogue DialogueNode current = convo.current; // Safety in case this conversation is empty if (!current) { Debug.LogError("Tried to start empty conversation!"); } ConversationInProgress = true; DialogueManager.Instance.SetState(DialogueManager.GameState.Dialogue); // Clear text box DialogueText.text = ""; NameText.text = ""; // And show it Fader.FadeIn(); // Wait to make sure it's shown yield return(new WaitForSeconds(Fader.FadeInTime)); // while there's still dialogue to be had while (current != null) { // Show the dialogue yield return(StartCoroutine(DisplayDialogue(current))); // attempt to move to the next node if (convo.Next()) { // if we can, set it to current current = convo.current; } else { // otherwise, the conversation is over current = null; // hide the text box Fader.FadeOut(); // wait to make sure it's gone yield return(new WaitForSeconds(Fader.FadeOutTime)); } } ConversationInProgress = false; // Dispatch an event saying this conversation is over EventDispatcher.Dispatch(ConversationEvent.Prepare(convo, false)); // Return the game state to gameplay DialogueManager.Instance.SetState(DialogueManager.GameState.Gameplay); }
private void Start() { fader.FadeIn(gameObject.GetComponentInParent <CanvasGroup>()); }