public IEnumerator StartScene() { foreach (CurrentSceneInfo currentScene in sceneInfos) { foreach (CurrentSceneActorInfo actorInfo in currentScene.actors) { ActorPlacementGroup actor = actors.Find(x => x.realname == actorInfo.name); actor.SwitchPostion(actorInfo.location, actorInfo.name); yield return(new WaitForSeconds(0.01f)); actor.CurrentPostion().NewMe(actorInfo.name); actorInfo.actor = actor; } foreach (string word in currentScene.order) { ActorPlacementGroup actor = actors.Find(x => x.realname == word); CurrentSceneActorInfo actorInfo = currentScene.actors.Find(x => x.actor == actor); yield return(new WaitForSeconds(0.01f)); actor.CurrentPostion().NewText(actorInfo.words); Debug.Log("heloo uthg"); yield return(new WaitUntil(() => actor.CurrentPostion().done == true)); actor.CurrentPostion().done = false; allDone++; } yield return(new WaitUntil(() => allDone >= currentScene.order.Count)); allDone = 0; } yield return(new WaitForSeconds(0.01f)); SceneManager.LoadScene("Town"); }
void Scene2() { List <CurrentSceneActorInfo> scene1Actors = new List <CurrentSceneActorInfo>(); List <string> order = new List <string>(); string book = ""; string file = "scene2TutorS"; string folder = "cutscene2"; string temp = ""; book = File.ReadAllText("Assets/TextFiles/" + folder + "/" + file + ".txt"); temp = book; CurrentSceneActorInfo scene1a1 = new CurrentSceneActorInfo("place12", "ActTutorSer", temp, "ActTutorSer"); scene1Actors.Add(scene1a1); file = "scene2Tutor"; book = File.ReadAllText("Assets/TextFiles/" + folder + "/" + file + ".txt"); temp = book; CurrentSceneActorInfo scene1a2 = new CurrentSceneActorInfo("place5", "ActTutor", temp, "ActTutor"); scene1Actors.Add(scene1a2); string[] actingOrder = { "ActTutorSer", "ActTutor" }; order.AddRange(actingOrder); CurrentSceneInfo scene1 = new CurrentSceneInfo(scene1Actors, order); sceneInfos.Add(scene1); StartCoroutine(StartScene()); }
void Scene3() { List <CurrentSceneActorInfo> sceneActors = new List <CurrentSceneActorInfo>(); List <string> order = new List <string>(); string book = ""; string file = "scene3Tutor"; string folder = "cutscene2"; string temp = ""; book = File.ReadAllText("Assets/TextFiles/" + folder + "/" + file + ".txt"); temp = book; CurrentSceneActorInfo scene1a1 = new CurrentSceneActorInfo("place30", "ActTutorHappy", temp, "ActTutorHappy"); sceneActors.Add(scene1a1); string[] actingOrder = { "ActTutorHappy" }; order.AddRange(actingOrder); CurrentSceneInfo scene1 = new CurrentSceneInfo(sceneActors, order); sceneInfos.Add(scene1); }
// Use this for initialization void Start() { StartUp(); List <CurrentSceneActorInfo> sceneActors = new List <CurrentSceneActorInfo>(); List <string> order = new List <string>(); string book = ""; string file = "scene1Melvin"; string folder = "cutscene1"; string temp = ""; book = File.ReadAllText("Assets/TextFiles/" + folder + "/" + file + ".txt"); temp = book; CurrentSceneActorInfo scene1a1 = new CurrentSceneActorInfo("place1", "ActMelvin", temp, "ActMelvin"); sceneActors.Add(scene1a1); string[] actingOrder = { "ActMelvin" }; order.AddRange(actingOrder); CurrentSceneInfo scene1 = new CurrentSceneInfo(sceneActors, order); sceneInfos.Add(scene1); Scene2(); }