private IEnumerator ShowSubmitResult(string password) { bombDialogController.Clear(); if (password == this.password) // CORRECT PASSWORD! { bombDialogController.Activate("correct_password"); source.PlayOneShot(success); yield return(new WaitForSeconds(3f)); bombDialogController.Clear(); gameOverDialogController.Activate("game_over1"); yield return(new WaitForSeconds(7f)); gameOverDialogController.Clear(); gameOverDialogController.Activate("game_over2"); yield return(new WaitForSeconds(7f)); gameOverDialogController.Clear(); gameOverDialogController.Activate("game_over3"); yield return(new WaitForSeconds(7f)); gameOverDialogController.Clear(); initDisplayController.FadeAlpha(1f); } else //WRONG PASSWORD! { bombDialogController.Activate("incorrect_password"); source.PlayOneShot(failure); } yield return(new WaitForSeconds(2f)); bombDialogController.Clear(); Player.instance.SetState(new Investigating(Player.instance)); }
private IEnumerator newHandleDisconnect() { if (_body) { _body.Hide(); } yield return(new WaitForSeconds(2)); GameObject.Destroy(GameObject.FindGameObjectWithTag("Score")); if (m_scenarioData.IAT.ScenarioName.Contains("PJ") || m_scenarioData.IAT.ScenarioName.Contains("Space")) { _finalScore.SetActive(true); GameObject.FindGameObjectWithTag("FinalScoreText").GetComponent <FinalScoreScript>().FinalScore(RPC.Mood); } m_dialogController.Clear(); }
private IEnumerator ShowMessages() { fader.CrossFadeAlpha(0f, 2f, false); yield return(new WaitForSeconds(2f)); dialogController.Activate("start0"); yield return(new WaitForSeconds(5f)); dialogController.Clear(); dialogController.Activate("start1"); yield return(new WaitForSeconds(5f)); dialogController.Clear(); dialogController.Activate("start2"); yield return(new WaitForSeconds(5f)); dialogController.Clear(); dialogController.Activate("start3"); yield return(new WaitForSeconds(5f)); dialogController.Clear(); dialogController.Activate("start4"); yield return(new WaitForSeconds(5f)); dialogController.Clear(); dialogController.Activate("start5"); yield return(new WaitForSeconds(8f)); dialogController.Clear(); Player.instance.frozen = false; yield return(null); }
// Use this for initialization private IEnumerator Start() { waitingforReply = false; Initialized = false; AssetManager.Instance.Bridge = new AssetManagerBridge(); m_dialogController.AddDialogLine("Loading..."); alreadyUsedDialogs = new Dictionary <string, string>(); var streamingAssetsPath = Application.streamingAssetsPath; #if UNITY_EDITOR || UNITY_STANDALONE streamingAssetsPath = "file://" + streamingAssetsPath; #endif var www = new WWW(streamingAssetsPath + "/scenarioList.txt"); yield return(www); if (!string.IsNullOrEmpty(www.error)) { m_dialogController.AddDialogLine("Error: " + www.error); yield break; } var entries = www.text.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None); if ((entries.Length % 2) != 0) { m_dialogController.AddDialogLine("Error: Scenario entries must in groups of 2 to identify the scenario file, and TTS directory"); yield break; } { List <ScenarioData> data = new List <ScenarioData>(); for (int i = 0; i < entries.Length; i += 2) { var path = entries[i].Trim(); var tts = entries[i + 1].Trim(); data.Add(new ScenarioData(path, tts)); } m_scenarios = data.ToArray(); } m_dialogController.Clear(); LoadScenarioMenu(); }
// Use this for initialization private void Start() { startingTime = DateTime.Now; sentencesToMatch = new List <string>(); rand = new System.Random(10); if (UnityEngine.XR.XRDevice.isPresent == false) { // Debug.Log("No VIVE detected"); foreach (var cam in cameras) { if (cam.tag == "MainCamera") { Debug.Log("no vr device detected"); SteamVR.SafeDispose(); UnityEngine.XR.XRSettings.enabled = false; GameObject.Find("[CameraRig]").SetActive(false); cam.SetActive(false); } if (cam.name == "2DCamera") { cam.SetActive(true); cam.tag = "MainCamera"; } } vr = false; } else { vr = true; UnityEngine.XR.XRSettings.enabled = true; SteamVR.enabled = true; } Initialized = false; // _finalScore = GameObject.FindGameObjectWithTag("FinalScore"); _finalScore.SetActive(false); AssetManager.Instance.Bridge = new AssetManagerBridge(); m_dialogController.AddDialogLine("Loading..."); alreadyUsedDialogs = new Dictionary <string, string>(); _questionsAnswers = new Dictionary <string, string>(); var streamingAssetsPath = Application.streamingAssetsPath; #if UNITY_EDITOR || UNITY_STANDALONE streamingAssetsPath = "file://" + streamingAssetsPath; #endif var www = new WWW(streamingAssetsPath + "/scenarioList.txt"); // yield return www; if (!string.IsNullOrEmpty(www.error)) { m_dialogController.AddDialogLine("Error: " + www.error); // yield break; } var entries = www.text.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None); if ((entries.Length % 2) != 0) { m_dialogController.AddDialogLine("Error: Scenario entries must in groups of 2, to identify the scenario file, and TTS directory"); // yield break; } { List <ScenarioData> data = new List <ScenarioData>(); for (int i = 0; i < entries.Length; i += 2) { var path = entries[i].Trim(); var tts = entries[i + 1].Trim(); data.Add(new ScenarioData(path, tts)); } m_scenarios = data.ToArray(); } var unorganizedPaperList = GameObject.FindGameObjectsWithTag("DialogHistory").ToList(); _paperList = unorganizedPaperList.OrderByDescending(p => p.transform.position.y).ToList(); // _paperList = GameObject.FindGameObjectsWithTag("DialogHistory").ToList(); currentOptions = new List <string>(); keyValuePairs = new Dictionary <string, float>(); alternativeKeyValuePairs = new Dictionary <string, float>(); MyStringBuilder = new StringBuilder(); m_dialogController.Clear(); LoadScenarioMenu(); }
// Use this for initialization private IEnumerator Start() { waitingforReply = false; Initialized = false; _finalScore = GameObject.FindGameObjectWithTag("FinalScore"); _finalScore.SetActive(false); AssetManager.Instance.Bridge = new AssetManagerBridge(); ; m_dialogController.AddDialogLine("Loading..."); alreadyUsedDialogs = new Dictionary <string, string>(); var streamingAssetsPath = Application.streamingAssetsPath; counter = 0; #if UNITY_EDITOR || UNITY_STANDALONE streamingAssetsPath = "file://" + streamingAssetsPath; #endif var www = new WWW(streamingAssetsPath + "/MultiCharacterScenarioList.txt"); yield return(www); if (!string.IsNullOrEmpty(www.error)) { m_dialogController.AddDialogLine("Error: " + www.error); yield break; } rpcList = new List <RolePlayCharacterAsset>(); m_characterAnchors = new List <Transform>(); foreach (var anc in GameObject.FindGameObjectsWithTag("Anchor")) { m_characterAnchors.Add(anc.transform); } _agentControllers = new List <MultiCharacterAgentController>(); justSpokeAgent = null; var entries = www.text.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None); if ((entries.Length % 2) != 0) { m_dialogController.AddDialogLine("Error: Scenario entries must in groups of 2, to identify the scenario file, and TTS directory"); yield break; } { List <SingleCharacterDemo.ScenarioData> data = new List <SingleCharacterDemo.ScenarioData>(); for (int i = 0; i < entries.Length; i += 2) { var path = entries[i].Trim(); var tts = entries[i + 1].Trim(); // Debug.Log(path + " e " + tts); data.Add(new SingleCharacterDemo.ScenarioData(path, tts)); } m_scenarios = data.ToArray(); } _events = new List <Name>(); _actions = new List <IAction>(); currentSocialMoveAction = ""; initiated = false; currentSocialMoveResult = ""; chosenTarget = Name.BuildName("ay"); m_dialogController.Clear(); LoadScenarioMenu(); }