void Awake() { if (event_to_trigger == null) { event_to_trigger = GetComponent <SequentialAction>(); } }
// Update is called once per frame void Update () { if (!started) { Debug.Log ("creating new sound action"); ActionRunner soundAction = new SoundAction ("chatter", false); ActionRunner soundAction2 = new SoundAction("happy", false); IList<ActionRunner> list = new List<ActionRunner> (); list.Add (soundAction); list.Add (soundAction2); ActionRunner parAction = new ParallelAction(list); list = new List<ActionRunner> (); list.Add (parAction); list.Add (parAction); ActionRunner seqAction = new SequentialAction(list); seqAction.Start (); started = true; } }
// Update is called once per frame void Update() { if (!started) { Debug.Log("creating new sound action"); ActionRunner soundAction = new SoundAction("chatter", false); ActionRunner soundAction2 = new SoundAction("happy", false); IList <ActionRunner> list = new List <ActionRunner> (); list.Add(soundAction); list.Add(soundAction2); ActionRunner parAction = new ParallelAction(list); list = new List <ActionRunner> (); list.Add(parAction); list.Add(parAction); ActionRunner seqAction = new SequentialAction(list); seqAction.Start(); started = true; } }
/** * Creates the gameState for the scene */ protected override IList<GameState> GetGameStatesList() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.main.GetComponent<DialogManager>(); GameObject patient = GameObject.Find ("patient"); SoundManager soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> (); GameObject obj = GameObject.FindGameObjectWithTag ("MainCamera"); if (obj == null) { Debug.LogError ("couldn't find Main Camera"); } soundManager.addSound (new Sound (obj, "Assets/Sounds/surreal_sound1.mp3", "surreal1")); soundManager.addSound (new Sound (GameObject.FindGameObjectWithTag ("MainCamera"), "Assets/Sounds/gibberish.mp3", "gibberish")); ActionRunner scene3HallucinateAction = new ParallelAction( new List<ActionRunner>() { new CameraInvertAction(), new LightPulseAction(), //TODO: Corey also sound affect new SoundAction("surreal1", true) } ); GameState scene3Hallucinate = new GameState ( "scene3Hallucinate", new Dictionary<Trigger, string> { {new ShakeTrigger(patient), "scene3RoseDialog"} }, scene3HallucinateAction ); ActionRunner scene3RoseDialogAction = new SequentialAction ( new List<ActionRunner>(){ new DialogAction("Whoa, what are you doing?"), new DialogAction("You okay?"), new DialogAction("I hope the flower Mom brought actually works"), new DialogAction("I mean, it does mean \"get-well-soon\""), } ); GameState scene3RoseDialog = new GameState ( "scene3RoseDialog", new Dictionary<Trigger, string> () { {new MainActionFinishedTrigger(), "scene3Rose"} }, scene3RoseDialogAction, scene3HallucinateAction ); GameState scene3Rose = new GameState( "scene3Rose", new Dictionary<Trigger, string> () { {new StareTrigger(patient, "rose"), "scene3Story"} }, new NoAction() ); ActionRunner scene3StoryAction = new SequentialAction (new List<ActionRunner> (){ new DialogAction("They weren't originally blue; they were red."), new DialogAction("Some people wanted to clone roses to see if they could breed them " + "true and get a reliable variety they could stock and sell."), new DialogAction("For some reason, " + "they got brown flowers instead of the red ones they wanted so they were about to stop " + "the funding, but they finally tried cloning the brown roses."), new DialogAction("The next clones were blue " + "and bred true enough for commercial purposes."), new DialogAction("The thing is, everyone wasn't too bothered " + "about roses being cloned, but when they moved the project to animals from roses, " + "that was when it went to hell."), new DialogAction("See, after the whole thing with the roses, there were ideas " + "to fix the underpopulation problem with cloning, but there was a crowd of people against " + "it."), new DialogAction("It was risky and unreliable, actually, the whole roses debacle was really a lucky bit."), new DialogAction("Mom is against it, as a matter of fact —it's why you two got into fights.") }); GameState scene3Story = new GameState ( "scene3Story", new Dictionary<Trigger, string>(), scene3StoryAction ); return new List<GameState> { scene3Hallucinate, scene3RoseDialog, scene3Rose, scene3Story }; }
/** * Creates the gameState for the PatientScene */ protected override IList<GameState> GetGameStatesList() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.mainCamera.GetComponent<DialogManager>(); SoundManager soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> (); AnimationManager animationManager = GameObject.Find ("animationManager").GetComponent<AnimationManager> (); GameObject person = GameObject.Find ("person"); AnimationClip animation = person.GetComponent<Animation> ().GetClip ("Take 001"); soundManager.addSound (new Sound (person, "Assets\\surreal sounds 4.mp3", "surrealSound")); GameObject obj = GameObject.Find ("Main Camera"); if (obj == null) { Debug.Log ("couldn't find Main Camera"); } List<ActionRunner> surrealEffects = new List<ActionRunner> (); surrealEffects.Add (new CameraInvertAction()); surrealEffects.Add (new SoundAction("surrealSound", true)); ParallelAction hallu = new ParallelAction (surrealEffects); List<ActionRunner> list = new List<ActionRunner> (); list.Add (new DialogAction ("How long have you been awake? Uh, actually, first, do you know where you are?")); SequentialAction visitor = new SequentialAction (list); DialogAction no1 = new DialogAction ("Well, we’re in St. Paul’s Hospital. It works with Lydersen Labs to develop pharmaceuticals. " + "Actually, I work here, but in the research side with people from Lydersen."); DialogAction yes1 = new DialogAction ("Oh, okay, that’s good."); DialogAction no2 = new DialogAction ("That’s fine, I’m just glad you’re okay. You got " + "hit by a car. I don’t know exactly what happened, but you’ve been in a coma for a while."); DialogAction yes2 = new DialogAction ("Yeah, that was a pretty bad crash. We were worried you wouldn’t make it."); DialogAction preDoctorQs = new DialogAction ("Okay, you should remember who you are, right? " + "The doctor gave me these questions to ask you, just making sure you’re all here."); DialogAction no3 = new DialogAction ("Wait, really? But that — In that case, do you remember me? "); DialogAction yes3 = new DialogAction ("See, I knew the doctor was worrying too much. In that case, you remember me, right?"); DialogAction no4 = new DialogAction ("I- um. I, well."); DialogAction yes4 = new DialogAction ("But then, how do — no, nevermind."); DialogAction WorldExpo = new DialogAction ("I’m your brother. Uh, I don’t know what to say… I work here and, \n" + "um, I do research in epigenetics. \n" + "This never happened before… I didn’t think that — the doctor did say you might…"); DialogAction question2 = new DialogAction ("Do you remember anything about how you got here?"); NodTrigger nodTrigger = new NodTrigger (obj); ShakeTrigger shakeTrigger = new ShakeTrigger (obj); if (dialog == null) { Debug.Log("null pointer with dialog"); } return new List<GameState> { new GameState( "hallucination", new Dictionary<Trigger, string>() { {shakeTrigger, "Visitor"} },hallu ), new GameState( "Visitor", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "QATime1"} }, visitor, hallu ), new GameState( "QATime1", new Dictionary<Trigger, string>() { {shakeTrigger, "no1"}, {nodTrigger, "yes1"} }, new NoAction() ), new GameState( "no1", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question2"} }, no1 ), new GameState( "yes1", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question2"} }, yes1 ), new GameState( "question2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "QATime2"} }, question2 ), new GameState( "QATime2", new Dictionary<Trigger, string>() { {shakeTrigger, "no2"}, {nodTrigger, "yes2"} }, new NoAction() ), new GameState( "no2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question3"} }, no2 ), new GameState( "yes2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question3"} }, yes2 ), new GameState( "question3", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "preQATime3"} }, preDoctorQs ), new GameState( "preQATime3", new Dictionary<Trigger, string>() { {shakeTrigger, "question4_no"}, {nodTrigger, "question4_yes"} }, new NoAction() ), new GameState( "question4_no", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "no3"} }, no3 ), new GameState( "no3", new Dictionary<Trigger, string>() { {shakeTrigger, "no4"}, {nodTrigger, "Scene3"} }, new NoAction() ), new GameState( "question4_yes", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "yes3"} }, yes3 ), new GameState( "yes3", new Dictionary<Trigger, string>() { {shakeTrigger, "no4"}, {nodTrigger, "yes4"} }, new NoAction() ), new GameState( "no4", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "WorldExpo"}, }, no4 ), new GameState( "yes4", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "WorldExpo"}, }, yes4 ), new GameState( "WorldExpo", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "Scene3"}, }, WorldExpo ), new GameState( "Scene3", new Dictionary<Trigger, string>() { }, new NoAction() ) }; }
/** * Creates the gameState for the scene */ protected override IList <GameState> GetGameStatesList() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.main.GetComponent <DialogManager>(); GameObject patient = GameObject.Find("patient"); SoundManager soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager> (); GameObject obj = GameObject.FindGameObjectWithTag("MainCamera"); if (obj == null) { Debug.LogError("couldn't find Main Camera"); } soundManager.addSound(new Sound(obj, "Assets/Sounds/surreal_sound1.mp3", "surreal1")); soundManager.addSound(new Sound(GameObject.FindGameObjectWithTag("MainCamera"), "Assets/Sounds/gibberish.mp3", "gibberish")); ActionRunner scene3HallucinateAction = new ParallelAction( new List <ActionRunner>() { new CameraInvertAction(), new LightPulseAction(), //TODO: Corey also sound affect new SoundAction("surreal1", true) } ); GameState scene3Hallucinate = new GameState( "scene3Hallucinate", new Dictionary <Trigger, string> { { new ShakeTrigger(patient), "scene3RoseDialog" } }, scene3HallucinateAction ); ActionRunner scene3RoseDialogAction = new SequentialAction( new List <ActionRunner>() { new DialogAction("Whoa, what are you doing?"), new DialogAction("You okay?"), new DialogAction("I hope the flower Mom brought actually works"), new DialogAction("I mean, it does mean \"get-well-soon\""), } ); GameState scene3RoseDialog = new GameState( "scene3RoseDialog", new Dictionary <Trigger, string> () { { new MainActionFinishedTrigger(), "scene3Rose" } }, scene3RoseDialogAction, scene3HallucinateAction ); GameState scene3Rose = new GameState( "scene3Rose", new Dictionary <Trigger, string> () { { new StareTrigger(patient, "rose"), "scene3Story" } }, new NoAction() ); ActionRunner scene3StoryAction = new SequentialAction(new List <ActionRunner> () { new DialogAction("They weren't originally blue; they were red."), new DialogAction("Some people wanted to clone roses to see if they could breed them " + "true and get a reliable variety they could stock and sell."), new DialogAction("For some reason, " + "they got brown flowers instead of the red ones they wanted so they were about to stop " + "the funding, but they finally tried cloning the brown roses."), new DialogAction("The next clones were blue " + "and bred true enough for commercial purposes."), new DialogAction("The thing is, everyone wasn't too bothered " + "about roses being cloned, but when they moved the project to animals from roses, " + "that was when it went to hell."), new DialogAction("See, after the whole thing with the roses, there were ideas " + "to fix the underpopulation problem with cloning, but there was a crowd of people against " + "it."), new DialogAction("It was risky and unreliable, actually, the whole roses debacle was really a lucky bit."), new DialogAction("Mom is against it, as a matter of fact —it's why you two got into fights.") }); GameState scene3Story = new GameState( "scene3Story", new Dictionary <Trigger, string>(), scene3StoryAction ); return(new List <GameState> { scene3Hallucinate, scene3RoseDialog, scene3Rose, scene3Story }); }
IList<GameState> GetScene2List() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.mainCamera.GetComponent<DialogManager>(); SoundManager soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> (); GameObject person = GameObject.Find ("person"); soundManager.addSound (new Sound ("Assets/Sounds/surreal_sound4.mp3", "surrealSound")); GameObject obj = GameObject.Find ("Main Camera"); if (obj == null) { Debug.Log ("couldn't find Main Camera"); } ParallelAction hallu = new ParallelAction (new CameraInvertAction(), new SoundAction("surrealSound", true)); SequentialAction visitor = new SequentialAction ( new ChildSelectorAction("Sibling", "normalpose"), new DialogAction("Sibling: I’m glad to see you’re awake."), new DialogAction("Sibling: We’re in St. Paul’s Hospital which works with Lydersen Labs to develop pharmaceuticals."), new DialogAction("Sibling: Actually, I work here, but in the research side with people from Lydersen.") ); DialogAction WorldExpo = new DialogAction ("I’m your brother. Uh, I don’t know what to say… I work here and, \n" + "um, I do research in epigenetics. \n" + "This never happened before… I didn’t think that — the doctor did say you might…"); if (dialog == null) { Debug.Log("null pointer with dialog"); } return new List<GameState> { new GameState( "hallucination", new Dictionary<Trigger, string>() { {new NodTrigger(), "Visitor"} },hallu ), new GameState( "Visitor", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question1Prompt"} }, visitor, hallu ), new GameState( "question1Prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question1"}}, new SequentialAction(new DialogAction("Sibling: We were really worried we were going to lose you, and there’s barely enough people around as it is…"), new DialogAction("Sibling: Do you remember your name?")) ), new GameState( "question1", new Dictionary<Trigger, string>(){ {new NodTrigger(), "question2prompt"}, {new ShakeTrigger(), "question3prompt"} }, new NoAction() ), new GameState( "question2prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question2"}}, new DialogAction("Sibling: See, I knew the doctor was worrying too much. In that case, you remember me, right?") ), new GameState( "question2", new Dictionary<Trigger, string>(){ {new NodTrigger(), "scene3Hallucinate"}, {new ShakeTrigger(), "question2No"} }, new NoAction() ), new GameState( "question2No", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "WorldExpo"}}, new DialogAction("I- um. I, well") ), new GameState( "question3prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question3"}}, new DialogAction("Sibling: Wait, really? But that — In that case, do you remember me?") ), new GameState( "question3", new Dictionary<Trigger, string>(){ {new NodTrigger(), "question3Yes"}, {new ShakeTrigger(), "question2No"} }, new NoAction() ), new GameState( "question3Yes", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "scene3Hallucinate"}}, new DialogAction("Sibling: But then, how do — no, nevermind.") ), new GameState( "WorldExpo", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "scene3Hallucinate"}, }, WorldExpo ) }; }
IList <GameState> GetScene2List() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.mainCamera.GetComponent <DialogManager>(); SoundManager soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager> (); GameObject person = GameObject.Find("person"); soundManager.addSound(new Sound("Assets/Sounds/surreal_sound4.mp3", "surrealSound")); GameObject obj = GameObject.Find("Main Camera"); if (obj == null) { Debug.Log("couldn't find Main Camera"); } ParallelAction hallu = new ParallelAction(new CameraInvertAction(), new SoundAction("surrealSound", true)); List <ActionRunner> list = new List <ActionRunner> (); list.Add(new DialogAction("How long have you been awake? Uh, actually, first, do you know where you are?")); SequentialAction visitor = new SequentialAction(list); DialogAction no1 = new DialogAction("Well, we’re in St. Paul’s Hospital. It works with Lydersen Labs to develop pharmaceuticals. " + "Actually, I work here, but in the research side with people from Lydersen."); DialogAction yes1 = new DialogAction("Oh, okay, that’s good."); DialogAction no2 = new DialogAction("That’s fine, I’m just glad you’re okay. You got " + "hit by a car. I don’t know exactly what happened, but you’ve been in a coma for a while."); DialogAction yes2 = new DialogAction("Yeah, that was a pretty bad crash. We were worried you wouldn’t make it."); DialogAction preDoctorQs = new DialogAction("Okay, you should remember who you are, right? " + "The doctor gave me these questions to ask you, just making sure you’re all here."); DialogAction no3 = new DialogAction("Wait, really? But that — In that case, do you remember me? "); DialogAction yes3 = new DialogAction("See, I knew the doctor was worrying too much. In that case, you remember me, right?"); DialogAction no4 = new DialogAction("I- um. I, well."); DialogAction yes4 = new DialogAction("But then, how do — no, nevermind."); DialogAction WorldExpo = new DialogAction("I’m your brother. Uh, I don’t know what to say… I work here and, \n" + "um, I do research in epigenetics. \n" + "This never happened before… I didn’t think that — the doctor did say you might…"); DialogAction question2 = new DialogAction("Do you remember anything about how you got here?"); NodTrigger nodTrigger = new NodTrigger(obj); ShakeTrigger shakeTrigger = new ShakeTrigger(obj); if (dialog == null) { Debug.Log("null pointer with dialog"); } return(new List <GameState> { new GameState( "hallucination", new Dictionary <Trigger, string>() { { shakeTrigger, "Visitor" } }, hallu ), new GameState( "Visitor", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "QATime1" } }, visitor, hallu ), new GameState( "QATime1", new Dictionary <Trigger, string>() { { shakeTrigger, "no1" }, { nodTrigger, "yes1" } }, new NoAction() ), new GameState( "no1", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "question2" } }, no1 ), new GameState( "yes1", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "question2" } }, yes1 ), new GameState( "question2", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "QATime2" } }, question2 ), new GameState( "QATime2", new Dictionary <Trigger, string>() { { shakeTrigger, "no2" }, { nodTrigger, "yes2" } }, new NoAction() ), new GameState( "no2", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "question3" } }, no2 ), new GameState( "yes2", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "question3" } }, yes2 ), new GameState( "question3", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "preQATime3" } }, preDoctorQs ), new GameState( "preQATime3", new Dictionary <Trigger, string>() { { shakeTrigger, "question4_no" }, { nodTrigger, "question4_yes" } }, new NoAction() ), new GameState( "question4_no", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "no3" } }, no3 ), new GameState( "no3", new Dictionary <Trigger, string>() { { shakeTrigger, "no4" }, { nodTrigger, "Scene3" } }, new NoAction() ), new GameState( "question4_yes", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "yes3" } }, yes3 ), new GameState( "yes3", new Dictionary <Trigger, string>() { { shakeTrigger, "no4" }, { nodTrigger, "yes4" } }, new NoAction() ), new GameState( "no4", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "WorldExpo" }, }, no4 ), new GameState( "yes4", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "WorldExpo" }, }, yes4 ), new GameState( "WorldExpo", new Dictionary <Trigger, string>() { { new MainActionFinishedTrigger(), "Scene3" }, }, WorldExpo ), new GameState( "Scene3", new Dictionary <Trigger, string>() { }, new NoAction() ) }); }