//public AnimationControl heartBeatAnim; private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ SingleTextStatement Stat3_3 = new SingleTextStatement( "已經將近十時\n你終於可以離開公司\n你拖著疲憊的身子準備回家", 4.5f, vrCamera, myGuiModels); DoubleChoiceQuestion Q2 = new DoubleChoiceQuestion( "此時,你的女朋友Jenny打電話給你\n問今晚可不可以見面", "表示自己\n加班很累\n想要回家休息", "答應Jenny\n和她見面", vrCamera, myGuiModels, SceneSwitchControl.Scene3Q2Name); Vector3 pos = GuiPrefabUtils.GetSelectionSlider1Text(Q2.underlyingGameObj).gameObject.transform.position; GuiPrefabUtils.GetSelectionSlider1Text(Q2.underlyingGameObj).gameObject.transform.position = new Vector3(pos.x, pos.y + 0.2f, pos.z); SingleTextStatement Stat4_0 = new SingleTextStatement( "「你只管顧著工作吧!不要再找我!」\nJenny忽然向你大發脾氣\n但你沒有感到很意外", 4.5f, vrCamera, myGuiModels); SingleTextStatement Stat4_1 = new SingleTextStatement( "繁忙的工作\n令你少了很多時間和心力\n經營與Jenny的這段關係", 4.5f, vrCamera, myGuiModels); SingleTextStatement Stat4_2 = new SingleTextStatement( "你有時覺得\n是Jenny不體諒自己", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat4_3 = new SingleTextStatement( "有時又會想\n難道我專注工作也錯了嗎?", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat4A_0 = new SingleTextStatement( "「我覺得我們最近好像很少見面。」", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat4A_1 = new SingleTextStatement( "一臉心事的Jenny這樣跟你說\n還和你提出不如大家冷靜一下 ……", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat4A_2 = new SingleTextStatement( "你明白Jenny的想法", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); /* end of adding text contents */ /* setting next stories or next scenes */ Stat3_3.AddNextStory(Q2); Q2.AddNextStory(Stat4_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q2.AddNextStory(Stat4A_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); Stat4_0.AddNextStory(Stat4_1); Stat4_1.AddNextStory(Stat4_2); Stat4_2.AddNextStory(Stat4_3); Stat4_3.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene3c_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); Stat4A_0.AddNextStory(Stat4A_1); Stat4A_1.AddNextStory(Stat4A_2); Stat4A_2.AddNextStory(Stat4_1); /* end of setting next stories or next scenes */ /* setting start gui */ Stat3_3.SetAsStartGui(storyStartManager); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }
//public AnimationControl heartBeatAnim; private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ SingleTextStatement Stat2_0 = new SingleTextStatement( "你遲到了", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); Stat2_0.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, false, classroomBell); SingleTextStatement Stat2_1 = new SingleTextStatement( "第一堂便是數學測驗", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat2_2 = new SingleTextStatement( "這次測驗不合格了", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat2A_0 = new SingleTextStatement( "你準時回到學校", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); Stat2A_0.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, false, classroomBell); //DoubleChoiceQuestion Q2 = new DoubleChoiceQuestion(doubleChoiceGui, // "坐在你身旁的好友Tony\n裝作不經意地碰碰你手臂\n把選擇題的答案展示給你", "抄襲好友答案", "拒絕出貓", // vrCamera, myGuiModels, SceneSwitchControl.Scene2Q2Name); //SingleTextStatement Stat2A_0 = new SingleTextStatement(singleTextGui, // "你準時回到學校\n第一堂便是數學測驗", GuiPrefabUtils.SingleTextGazeDuration, // vrCamera, myGuiModels); //Stat2A_0.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, false, classroomBell); //SingleTextStatement Stat2A_1 = new SingleTextStatement(singleTextGui, // "依然睡眼惺忪的你,望著試卷\n腦袋好像僵住了一樣", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); //SingleTextStatement Stat3_0 = new SingleTextStatement(singleTextGui, // "就在你不斷抄寫Tony的答案時\n忽然有人敲敲你的桌子", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); //SingleTextStatement Stat3_1 = new SingleTextStatement(singleTextGui, // "被發現了!\n老師發現你和Tony作弊", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); //SingleTextStatement Stat3_2 = new SingleTextStatement(singleTextGui, // "你的操行紀錄上\n被刻上無法磨滅的缺點", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); //SingleTextStatement Stat3_3 = new SingleTextStatement(singleTextGui, // "而你和Tony\n也多了一個互相嘲笑的回憶", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); //SingleTextStatement Stat3A_0 = new SingleTextStatement(singleTextGui, // "這次測驗要不合格了\n但你寧願接受一個真正的成績", // GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); /* end of adding text contents */ /* setting next stories or next scenes */ Stat2_0.AddNextStory(Stat2_1); Stat2_1.AddNextStory(Stat2_2); Stat2_2.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene2cName, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); Stat2A_0.AddNextStory(Stat2_1); /* end of setting next stories or next scenes */ /* setting start gui */ twoChoiceStoryStartManager.m_Option1StartFader = GuiPrefabUtils.GetUiFader(Stat2_0.underlyingGameObj); twoChoiceStoryStartManager.m_Option1StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Stat2_0.underlyingGameObj); twoChoiceStoryStartManager.m_Option2StartFader = GuiPrefabUtils.GetUiFader(Stat2A_0.underlyingGameObj); twoChoiceStoryStartManager.m_Option2StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Stat2A_0.underlyingGameObj); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }
private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ DoubleTextStatement Stat0_0 = new DoubleTextStatement(Color.white, "- 你來了 -", "一切,無聲無息,無從解釋", GuiPrefabUtils.DoubleTextFirstGazeDuration, GuiPrefabUtils.DoubleTextSecondGazeDuration, vrCamera, myGuiModels); Stat0_0.AddPlayAnimationOnDoubleTextGazeComplete(heartBeatAnim); SingleTextStatement Stat0_2 = new SingleTextStatement(Color.white, "漸漸的,你開始聽到心臟微微跳動\n感受到身體被一種暖流包裹", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); Stat0_2.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, true, heartBeatClip); SingleTextStatement Stat0_3 = new SingleTextStatement(Color.white, "生命,悄悄滋長 ……", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleChoiceQuestion Q1 = new SingleChoiceQuestion(Color.white, "你願意來到這個世界\n經歷這一趟人生旅程嗎?", "我願意", vrCamera, myGuiModels); /* end of adding text contents */ /* setting next stories or next scenes */ Stat0_0.AddNextStory(Stat0_2); Stat0_2.AddNextStory(Stat0_3); Stat0_3.AddNextStory(Q1); Q1.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene1bName); /* end of setting next stories or next scenes */ /* setting start gui */ //Stat0_0.SetAsStartGui(storyStartManager); // Hard coded here NextStory nextStoryOfStartObj = SingleChoiceObjectBeforeStart.transform.Find("SelectionSlider").GetComponent <NextStory>(); nextStoryOfStartObj.nextUiFader = GuiPrefabUtils.GetUiFader(Stat0_0.underlyingGameObj); nextStoryOfStartObj.nextDoubleTextForGaze = GuiPrefabUtils.GetDoubleTextForGaze(Stat0_0.underlyingGameObj); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }
private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ DoubleTextStatement Stat2_2_0 = new DoubleTextStatement(Color.white, "- 60歲 -", "你開始邁向退休的年紀", GuiPrefabUtils.DoubleTextFirstGazeDuration, GuiPrefabUtils.DoubleTextSecondGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat2_2_1 = new SingleTextStatement(Color.white, "女兒也已經30歲\n到了結婚的年齡", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat2_3 = new SingleTextStatement(Color.white, "看著她也擁有自己的家庭\n你感到放心安慰", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); DoubleChoiceQuestion Q2 = new DoubleChoiceQuestion(Color.white, "她要搬離你的家\n和她的丈夫一起居住了 ……", "無奈接受", "欣然接受", vrCamera, myGuiModels, SceneSwitchControl.Scene5Q2Name); SingleTextStatement Stat3_0 = new SingleTextStatement(Color.white, "這時你才發現,原來你不捨得", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat3_1 = new SingleTextStatement(Color.white, "她已經長大了,你無從改變 ……", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); DoubleTextStatement Stat3_2_0 = new DoubleTextStatement(Color.white, "- 82歲 -", "你患上末期癌症,需要長期進出醫院", GuiPrefabUtils.DoubleTextFirstGazeDuration, GuiPrefabUtils.DoubleTextSecondGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat3_2_1 = new SingleTextStatement(Color.white, "你回來了", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); Stat3_2_1.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, false, hospitalCurtainClip); SingleTextStatement Stat3_3 = new SingleTextStatement(Color.white, "你年老乏力的身體\n就如嬰孩時期般軟弱無力", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); scene5Q3ClipSource = Stat3_3.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, true, scene5Q3Clip); SingleTextStatement Stat3_4 = new SingleTextStatement(Color.white, "當你看到你女兒、女婿、\n孫子、親友全都圍在你床邊\n文珊靠在你床邊,哭成淚人的樣子時 ……", 6f, vrCamera, myGuiModels); SingleTextStatement Stat3_5 = new SingleTextStatement(Color.white, "你就意識到自己是差不多走到盡頭了", 4f, vrCamera, myGuiModels); SingleTextStatement Stat3_6 = new SingleTextStatement(Color.white, "你忽然想起過往很多和文珊的經歷片段", 4f, vrCamera, myGuiModels); SingleTextStatement Stat3_7 = new SingleTextStatement(Color.white, "第一次約會、第一次吵架、結婚、生小孩、\n一起為工作煩惱、一起為小孩擔憂、\n互相鼓勵、互相安慰 ……", 6f, vrCamera, myGuiModels); DoubleChoiceQuestion Q3 = new DoubleChoiceQuestion(Color.white, "慢慢的\n你的臉頰也流下了兩行淚水 ……", "默然不語", "跟文珊說:\n「謝謝你,\n我愛你。」", vrCamera, myGuiModels, SceneSwitchControl.Scene5Q3Name); Vector3 pos2 = GuiPrefabUtils.GetSelectionSlider2Text(Q3.underlyingGameObj).gameObject.transform.position; GuiPrefabUtils.GetSelectionSlider2Text(Q3.underlyingGameObj).gameObject.transform.position = new Vector3(pos2.x, pos2.y + 0.2f, pos2.z); SingleTextStatement Stat4_0 = new SingleTextStatement(Color.white, "這就是你的理想人生嗎?\n有時你會這樣問自己", 4f, vrCamera, myGuiModels); scene5Q4ClipSource = Stat4_0.AddPlayAudioOnUiFadeInReachThreshold(0.5f, true, scene5Q4Clip, 0f); SingleTextStatement Stat4_1 = new SingleTextStatement(Color.white, "漸漸的,你又開始聽到心臟微微的跳動\n感受到身體被一種暖流包裹", 4f, vrCamera, myGuiModels); Stat4_1UiFader = GuiPrefabUtils.GetUiFader(Stat4_1.underlyingGameObj); //heartbeatAudio = Stat4_1.AddPlayAudioOnUiFadeInComplete(GuiPrefabUtils.SceneSoundEffectVolume, true, heartbeatClip); Stat4_1.AddPlayAnimationOnUiFadeInComplete(heartbeatAnimationControl); SingleTextStatement Stat4_2 = new SingleTextStatement(Color.white, "生命,悄悄消逝 ……", 4f, vrCamera, myGuiModels); SingleChoiceQuestion Q4 = new SingleChoiceQuestion(Color.white, "你願意離開這個世界\n結束這一趟人生旅程嗎?", "我願意", vrCamera, myGuiModels); Q4UiFader = GuiPrefabUtils.GetUiFader(Q4.underlyingGameObj); scene5Q4LoopClipSource = Q4.AddPlayAudioOnUiFadeInReachThreshold(GuiPrefabUtils.SceneSoundEffectVolume, true, scene5Q4LoopClip, 0f); passAwaySelectionSlider = GuiPrefabUtils.GetSelectionSlider(Q4.underlyingGameObj); Q4.SetOnFilledAudioClipForSlider(null); SingleTextStatement Stat4_A = new SingleTextStatement(Color.white, "「我也愛你。」\n文珊抹一抹眼淚,跟你說", 4f, vrCamera, myGuiModels); SingleTextStatement End_1 = new SingleTextStatement(Color.white, "人生 …… 總是經歷選擇、擁有與失去\n你未必可以完全掌控你的人生\n更無法回到過去再來一次", GuiPrefabUtils.LastSceneSingleTextGazeDuration, vrCamera, myGuiModels); //UIFader End_1UiFader = GuiPrefabUtils.GetUiFader(End_1.underlyingGameObj); //End_1UiFader.m_FadeSpeed = 0.2f; SingleTextStatement End_2 = new SingleTextStatement(Color.white, "但是 …… 以甚麼心態面對人生起跌\n如何與你覺得重要的人相處\n是可以由你來決定", GuiPrefabUtils.LastSceneSingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_3 = new SingleTextStatement(Color.white, "人,只可活一次!", GuiPrefabUtils.LastSceneSingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_4 = new SingleTextStatement(Color.white, "回到現實,你會如何繼續你的人生呢?", GuiPrefabUtils.LastSceneSingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_5 = new SingleTextStatement(Color.white, "(請脫下眼鏡,遵循工作人員指示離開)", 3600f, vrCamera, myGuiModels); //SingleTextStatement /* end of adding text contents */ /* setting next stories or next scenes */ Stat2_2_0.AddNextStory(Stat2_2_1); Stat2_2_1.AddNextStory(Stat2_3); Stat2_3.AddNextStory(Q2); Q2.AddNextStory(Stat3_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q2.AddNextStory(Stat3_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); Stat3_0.AddNextStory(Stat3_1); Stat3_1.AddNextStory(Stat3_2_0); Stat3_2_0.AddNextStory(Stat3_2_1); Stat3_2_1.AddNextStory(Stat3_3); Stat3_3.AddNextStory(Stat3_4); Stat3_4.AddNextStory(Stat3_5); Stat3_5.AddNextStory(Stat3_6); Stat3_6.AddNextStory(Stat3_7); Stat3_7.AddNextStory(Q3); Q3.AddNextStory(Stat4_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q3.AddNextStory(Stat4_A, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); Stat4_0.AddNextStory(Stat4_1); Stat4_1.AddNextStory(Stat4_2); Stat4_2.AddNextStory(Q4); Stat4_A.AddNextStory(Stat4_0); //Q4.AddNextScene(vrCamera.GetComponent<VRCameraFade>(), // GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene5dName); Q4.AddNextStory(End_1); End_1.AddNextStory(End_2); End_2.AddNextStory(End_3); End_3.AddNextStory(End_4); End_4.AddNextStory(End_5); /* end of setting next stories or next scenes */ /* setting start gui */ Stat2_2_0.SetAsStartGui(storyStartManager); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }
private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ SingleTextStatement Stat5_2 = new SingleTextStatement( "你找到一間年輕的企業\n沒有大公司的穩定保障\n但也沒有太多傳統規矩、\n壁壘分明的上司下屬關係 ……", 4.5f, vrCamera, myGuiModels); SingleTextStatement Stat5_3 = new SingleTextStatement( "雖然工作有時也會很繁忙\n但這公司明顯更符合你的個性", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat5_4 = new SingleTextStatement( "在公司工作多年\n漸漸得到上司賞識和晉升機會", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat5_5 = new SingleTextStatement( "你偶爾瀏覽Facebook\n剛發現Jenny發佈了一張新照片\n她和新男友甜蜜合照", 4.5f, vrCamera, myGuiModels); SingleTextStatement Stat5_6 = new SingleTextStatement( "你望著照片,祝福她、感謝她\n是她令你重新掌握到自己生活的節奏\n留意身邊的人和事", 4.5f, vrCamera, myGuiModels); DoubleChoiceQuestion Q4 = new DoubleChoiceQuestion( "此時\n坐在你旁邊的新入職同事文珊\n對著電腦螢幕一臉緊張地敲打鍵盤", "沖一杯咖啡\n給文珊\n為她打氣", "笑笑不理\n繼續自己的工作", vrCamera, myGuiModels, SceneSwitchControl.Scene3Q4Name); Vector3 pos2 = GuiPrefabUtils.GetSelectionSlider1Text(Q4.underlyingGameObj).gameObject.transform.position; GuiPrefabUtils.GetSelectionSlider1Text(Q4.underlyingGameObj).gameObject.transform.position = new Vector3(pos2.x, pos2.y + 0.2f, pos2.z); SingleTextStatement End_0 = new SingleTextStatement( "文珊感謝你的體貼關心\n跟你分享工作上的煩惱", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_1 = new SingleTextStatement( "你聽著文珊的煩惱,彷彿想起當年\n剛畢業投身工作的自己", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_2 = new SingleTextStatement( "「不要緊的\n這個問題可以解決得了。」\n你提供意見,幫助文珊", 4.5f, vrCamera, myGuiModels); SingleTextStatement End_3 = new SingleTextStatement( "對,不要緊的\n問題始終可以解決得了 ……", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndA_0 = new SingleTextStatement( "你望著文珊煩惱的樣子\n彷彿想起當年剛畢業\n投身工作的自己", 4.5f, vrCamera, myGuiModels); SingleTextStatement EndA_1 = new SingleTextStatement( "或許每個人都需要經歷\n一次進入社會的迷惘吧?", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndA_2 = new SingleTextStatement( "「不要緊的,問題始終可以解決得了。」\n你心裡這樣想", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndA_3 = new SingleTextStatement( "你心裡這樣相信", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); /* end of adding text contents */ /* setting next stories or next scenes */ Stat5_2.AddNextStory(Stat5_3); Stat5_3.AddNextStory(Stat5_4); Stat5_4.AddNextStory(Stat5_5); Stat5_5.AddNextStory(Stat5_6); Stat5_6.AddNextStory(Q4); Q4.AddNextStory(End_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q4.AddNextStory(EndA_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); End_0.AddNextStory(End_1); End_1.AddNextStory(End_2); End_2.AddNextStory(End_3); End_3.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene4a_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); EndA_0.AddNextStory(EndA_1); EndA_1.AddNextStory(EndA_2); EndA_2.AddNextStory(EndA_3); EndA_3.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene4a_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); /* end of setting next stories or next scenes */ /* setting start gui */ //Stat5_2.SetAsStartGui(storyStartManager); storyStartManager.m_LastQuestionIdentifier = SceneSwitchControl.Scene3Q3Name; storyStartManager.m_Option1StartFader = GuiPrefabUtils.GetUiFader(Stat5_2.underlyingGameObj); storyStartManager.m_Option1StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Stat5_2.underlyingGameObj); storyStartManager.m_Option2StartFader = GuiPrefabUtils.GetUiFader(Stat5_4.underlyingGameObj); storyStartManager.m_Option2StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Stat5_4.underlyingGameObj); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }
private void Awake() { IList <GuiModelBase> myGuiModels = new List <GuiModelBase>(); /* adding text contents */ DoubleChoiceQuestion Q6 = new DoubleChoiceQuestion( "你抽中了兩張演唱會的門卷\n想邀請Jenny一同觀看,可是演唱會的日子\n正是校內模擬試的備試時期", "依然邀請Jenny\n一同觀看", "把演唱會門票\n送給別人\n專注預備模擬試", vrCamera, myGuiModels, SceneSwitchControl.Scene2Q5Name); Vector3 pos = GuiPrefabUtils.GetSelectionSlider2Text(Q6.underlyingGameObj).gameObject.transform.position; GuiPrefabUtils.GetSelectionSlider2Text(Q6.underlyingGameObj).gameObject.transform.position = new Vector3(pos.x, pos.y + 0.2f, pos.z); SingleTextStatement End_0 = new SingleTextStatement( "Jenny答應了你\n你們一起去了聽演唱會\n渡過了一個愉快的晚上", 4.5f, vrCamera, myGuiModels); SingleTextStatement End_1 = new SingleTextStatement( "代價是\n你的模擬試也考得一塌糊塗", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_2 = new SingleTextStatement( "「已經追不上了吧?」\n你對考大學失去了信心", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_3 = new SingleTextStatement( "考不上大學的話\n我應該怎麼辦?\n未來,應該怎麼辦?", 4.0f, vrCamera, myGuiModels); SingleTextStatement End_5 = new SingleTextStatement( "但你開始問自己這個問題的時候\n那就意味著", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement End_6 = new SingleTextStatement( "你長大了 ……", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement Stat6A_0 = new SingleTextStatement( "你其實對這樣重覆的生活感到厭悶", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); DoubleChoiceQuestion Q6A = new DoubleChoiceQuestion( "有一天,你抽中了演唱會的門券\n想找朋友一同觀看,可是演唱會的日子\n正是校內模擬試的前夕", "依然邀請朋友\n一同觀看", "把演唱會門票\n送給別人\n專注預備模擬試", vrCamera, myGuiModels, SceneSwitchControl.Scene2Q5Name); Vector3 pos2 = GuiPrefabUtils.GetSelectionSlider2Text(Q6A.underlyingGameObj).gameObject.transform.position; GuiPrefabUtils.GetSelectionSlider2Text(Q6A.underlyingGameObj).gameObject.transform.position = new Vector3(pos2.x, pos2.y + 0.2f, pos2.z); SingleTextStatement EndA_0 = new SingleTextStatement( "演唱會十分精彩\n你和朋友們享受了愉快的一天", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndA_1 = new SingleTextStatement( "代價是\n你的模擬試也考得一塌糊塗", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndB_0 = new SingleTextStatement( "你始終覺得\n應付公開試比較重要", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndB_1 = new SingleTextStatement( "你憧憬著大學美好的生活\n這使你讀書更加有動力", GuiPrefabUtils.SingleTextGazeDuration, vrCamera, myGuiModels); SingleTextStatement EndB_2 = new SingleTextStatement( "大學生活\n到底是怎樣的呢?\n未來,到底是怎樣的呢?", 4.0f, vrCamera, myGuiModels); /* end of adding text contents */ /* setting next stories or next scenes */ Q6.AddNextStory(End_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q6.AddNextStory(EndB_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); End_0.AddNextStory(End_1); End_1.AddNextStory(End_2); End_2.AddNextStory(End_3); End_3.AddNextStory(End_5); End_5.AddNextStory(End_6); End_6.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene3a_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); EndB_0.AddNextStory(EndB_1); EndB_1.AddNextStory(EndB_2); EndB_2.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene3a_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); Stat6A_0.AddNextStory(Q6A); Q6A.AddNextStory(EndA_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider1); Q6A.AddNextStory(EndB_0, DoubleChoiceQuestion.SelectionSlider1Or2.Slider2); EndA_0.AddNextStory(EndA_1); EndA_1.AddNextScene(vrCamera.GetComponent <VRCameraFade>(), GuiPrefabUtils.CameraFadeDuration, SceneSwitchControl.Scene3a_0Name, AudSrcsToFadeOut, GuiPrefabUtils.AudioFadeDuration); /* end of setting next stories or next scenes */ /* setting start gui */ twoChoiceStoryStartManager.m_LastQuestionIdentifier = SceneSwitchControl.Scene2Q5Name; twoChoiceStoryStartManager.m_Option1StartFader = GuiPrefabUtils.GetUiFader(Q6.underlyingGameObj); twoChoiceStoryStartManager.m_Option1StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Q6.underlyingGameObj); twoChoiceStoryStartManager.m_Option2StartFader = GuiPrefabUtils.GetUiFader(Stat6A_0.underlyingGameObj); twoChoiceStoryStartManager.m_Option2StartTextForGaze = GuiPrefabUtils.GetTextForGaze(Stat6A_0.underlyingGameObj); //Stat5_1.SetAsStartGui(storyStartManager); /* end of setting start gui */ /* activating guis */ // [Important] This is needed because the prefab game objects are set to be inactive so that the OnEnable event is not called during Prefab Instantiation. foreach (GuiModelBase myGuiModel in myGuiModels) { myGuiModel.SetActive(true); } /* end of activating guis */ }