From 13a7ac24b2f172949ffb983ef92e8d5ed976066c Mon Sep 17 00:00:00 2001 From: Scott Hutter Date: Thu, 3 Aug 2017 19:51:41 -0500 Subject: [PATCH] Refactor, typing commands to character, relax animation --- Assets/Animations/lcp-man.controller | Bin 12944 -> 13456 bytes Assets/Animations/relaxing.anim | Bin 0 -> 17688 bytes Assets/Animations/relaxing.anim.meta | 9 +++ Assets/Scenes/Main.unity | Bin 185456 -> 187008 bytes Assets/Scripts/LcpManController.cs | 90 ++++++++--------------- Assets/Scripts/TypewriterController.cs | 94 ++++++++++++++++++++++++- ProjectSettings/GraphicsSettings.asset | Bin 4402 -> 4414 bytes 7 files changed, 130 insertions(+), 63 deletions(-) create mode 100644 Assets/Animations/relaxing.anim create mode 100644 Assets/Animations/relaxing.anim.meta diff --git a/Assets/Animations/lcp-man.controller b/Assets/Animations/lcp-man.controller index 6b3933e5f0b4f01d315c5b1802fa4edcabe71aa8..3c57e3d870ed3bb5b5a80fd89b41c46faf09bcaf 100644 GIT binary patch delta 1008 zcmZ9KZAep57{|}u=KITY#h}uab2IJb&fS$C)>@=yc&~G74GM)K^QD@YNm`6v*oa|f ziEAfnAk;oYMjz6e;fRRQ3#1=nkU@>gS@t2YT%qfE_?M;D%Z&iS4HInO!I`McZP zHX0%2L4+#Y2%$XEciyL8tyLA15kir0f2%)01Y96`>OeDU+qA`t?hsd%prkng|o$?LxU`ZE~=*I^ovb#J42}`Wyu6U%I#(7{f zL|xNHdd<)q9(+kGaLw^ZGQ`#aohb^tUh?7D{yK0bvC`?8W5cVB5GAaKR7Q9V>-U|f zTIEJKnkBO4Tpw>=XM_l0_PFl!#E9(Tq7fRhMfSvc{2Mb~4lVkKgh*hemb(9F}BhF1CG>S3AwYS57XLxTKO#TgWi zC}r59Os6vajmisD9w`j6bz9py4%uy;M-Y&@Vvp04!meJu^MlK}w zs1^7QW5D~>IxJUL;*eU7BjpP0C1bAKfU`*iNw`SpGzMY0N29|5((TdI;LB`$7dc+g x&{QT)VY^e8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@I7FwYXEbWC zH(PAuLB`}?h;QS}iQJEniA9S=FM&`UT`Eq7tKSnByWt=G*^Qmc#0ViXSBd~5V1>vK z2rf45*-Y*o1LV8wT~fAME;YlVp<$;A;V9LYrL%r%0+w;tIi-q eI%lP;5;@z>Uu^7ENSV?q+{q^SIUOK~y#E51_gWqR diff --git a/Assets/Scripts/LcpManController.cs b/Assets/Scripts/LcpManController.cs index 6b49e17..a72a79d 100644 --- a/Assets/Scripts/LcpManController.cs +++ b/Assets/Scripts/LcpManController.cs @@ -36,7 +36,8 @@ public enum Activities Phone, Attic, Closet, - Refrigerator + Refrigerator, + WashDishes } public enum CharacterStates { @@ -108,62 +109,7 @@ private void Update() private void HandleInput() { - if (Input.GetKeyDown("v")) - { - activityQueue.Push(Activities.TVChair); - } - - if (Input.GetKeyDown("s")) - { - activityQueue.Push(Activities.Sleep); - } - - if (Input.GetKeyDown("t")) - { - activityQueue.Push(Activities.Toilet); - } - - if (Input.GetKeyDown("b")) - { - activityQueue.Push(Activities.ReadBook); - } - if (Input.GetKeyDown("w")) - { - activityQueue.Push(Activities.Typewriter); - } - - if (Input.GetKeyDown("e")) - { - activityQueue.Push(Activities.Exercise); - } - - if (Input.GetKeyDown("f")) - { - activityQueue.Push(Activities.Cupboard); - } - - if (Input.GetKeyDown("l")) - { - activityQueue.Push(Activities.LeaveHouse); - } - - if (Input.GetKeyDown("z")) - { - activityQueue.Push(Activities.Attic); - } - if (Input.GetKeyDown("x")) - { - activityQueue.Push(Activities.Closet); - } - if (Input.GetKeyDown("r")) - { - activityQueue.Push(Activities.Sofa); - } - - - - - if (Input.GetKeyDown("a")) + if (isControlKeyPressed() && Input.GetKeyDown(KeyCode.A)) { GameObject.Find("Alarm_clock").GetComponent().Play(); if (currentActivity == Activities.Sleep) @@ -173,10 +119,11 @@ private void HandleInput() } } - if (Input.GetKeyDown("c")) + if (isControlKeyPressed() && Input.GetKeyDown(KeyCode.C)) { GameObject.Find("Phone_Base").GetComponent().state = PhoneController.States.ringing; activityQueue.Push(Activities.Phone); + FinishedActivity(currentActivity); } if (Input.GetKeyDown(KeyCode.Escape)) @@ -185,6 +132,11 @@ private void HandleInput() } } + private bool isControlKeyPressed() + { + return Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl); + } + void GoToActivity(Activities activity) { if (activity == Activities.TV) @@ -258,6 +210,9 @@ void GoToActivity(Activities activity) if (activity == Activities.Refrigerator) StartWalk(1, new Vector3(7.11f, 2.1f, 1.95f), Path.FacingDirection.backward, 3); + + if (activity == Activities.WashDishes) + StartWalk(1, new Vector3(5.22f, 2.1f, 1.63f), Path.FacingDirection.backward, 5); } void StartActivity(Activities activity) @@ -275,7 +230,7 @@ void StartActivity(Activities activity) PlaySound("speak1", true); } - if (currentActivity == Activities.BathroomSink) + if (currentActivity == Activities.BathroomSink || currentActivity == Activities.WashDishes) { PlaySound("sink", true); } @@ -301,7 +256,15 @@ void StartActivity(Activities activity) if (GameObject.Find("Book").GetComponent().enabled == true) characterModel.GetComponent().SetBool("isReading", true); else - characterModel.GetComponent().SetBool("isSitting", true); + { + int r = UnityEngine.Random.Range(1, 3); + + if (r == 1) + characterModel.GetComponent().SetBool("isSitting", true); + else + characterModel.GetComponent().SetBool("isRelaxing", true); + } + } if (currentActivity == Activities.Phone) @@ -325,7 +288,8 @@ void StartActivity(Activities activity) } if (currentActivity == Activities.Cupboard || currentActivity == Activities.ComputerDesk - || currentActivity == Activities.Typewriter || currentActivity == Activities.BathroomSink || currentActivity == Activities.Piano) + || currentActivity == Activities.Typewriter || currentActivity == Activities.BathroomSink + || currentActivity == Activities.Piano || currentActivity == Activities.WashDishes) { characterModel.GetComponent().SetBool("isDoing", true); } @@ -574,6 +538,7 @@ private void StopAnimations() characterModel.GetComponent().SetBool("isEating", false); characterModel.GetComponent().SetBool("isExercising", false); characterModel.GetComponent().SetBool("isReading", false); + characterModel.GetComponent().SetBool("isRelaxing", false); GameObject.Find("Shower").GetComponent().Stop(); GetComponent().Stop(); @@ -593,7 +558,7 @@ Activities GetNextActivity() return Activities.Sleep; } - int nextActivity = UnityEngine.Random.Range(1, 24); + int nextActivity = UnityEngine.Random.Range(1, 25); switch (nextActivity) { @@ -620,6 +585,7 @@ Activities GetNextActivity() case 21: return Activities.Phone; case 22: return Activities.Attic; case 23: return Activities.Closet; + case 24: return Activities.WashDishes; } return Activities.FrontDoor; diff --git a/Assets/Scripts/TypewriterController.cs b/Assets/Scripts/TypewriterController.cs index 7b1e343..af88179 100644 --- a/Assets/Scripts/TypewriterController.cs +++ b/Assets/Scripts/TypewriterController.cs @@ -1,4 +1,5 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -141,6 +142,9 @@ private IEnumerator PlayerInput(string v) TypewriterHead.transform.position = typewriterHeadDefaultPosition; lastPlayerEntered = TextLines[TextLines.Count - 2].text; + + PlayerInputHandler(lastPlayerEntered); + } else if(s == "\b") { @@ -181,4 +185,92 @@ private IEnumerator PlayerInput(string v) Hide(); } + + private void PlayerInputHandler(string input) + { + GameObject go = GameObject.Find("character"); + + input = input.ToLower(); + + if (input.Contains("please")) + { + if(input.Contains("read")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.ReadBook); + } + + if (input.Contains("type") || input.Contains("write") || input.Contains("letter")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Typewriter); + } + + if (input.Contains("tv") || input.Contains("television")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.TVChair); + } + + if (input.Contains("sleep") || input.Contains("bed") || input.Contains("bedtime")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Sleep); + } + + if (input.Contains("sofa") || input.Contains("relax") || input.Contains("rest")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Sofa); + } + + if (input.Contains("play") || input.Contains("piano") || input.Contains("music")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Piano); + } + + if (input.Contains("call") || input.Contains("telephone") || input.Contains("phone")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Phone); + } + + if (input.Contains("eat") || input.Contains("food") || input.Contains("dinner") || input.Contains("lunch") || input.Contains("breakfast")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Cupboard); + } + + if (input.Contains("fire") || input.Contains("fireplace") || input.Contains("chimney")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.BuildFire); + } + + if (input.Contains("dressed") || input.Contains("clothes") || input.Contains("shirt")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Closet); + } + + if (input.Contains("shower") || input.Contains("bath")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Shower); + } + + if (input.Contains("leave") || input.Contains("bye")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.LeaveHouse); + } + + if (input.Contains("exercise")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.Exercise); + } + + if (input.Contains("dishes")) + { + go.GetComponent().activityQueue.Push(LcpManController.Activities.WashDishes); + } + + } + + if (input == "help") + { + TextLines[0].text = "Try saying 'please' before a command!"; + TextLines[1].text = "CTRL-A = alarm clock, wake up"; + TextLines[2].text = "CTRL-C = call"; + } + } } diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 4d83239e991779346d08546e0cd02d4982088b99..b7e87d003ba6652e2a265254fb41b7e94fc1e809 100644 GIT binary patch delta 40 wcmdm_v`>kHfq{Ps1B0O5MvfeQM!U_W{QQiJ9FtoG!dV#^7#JESUloW20KG{GT>t<8 delta 34 qcmdm|v`LABfq{Ps1B0N^MvfeQMx)K8{QQiJ?2}ss!Y98F2m=6){0PYa