diff --git a/SSLR/Assets/NpcModels/Prefabs/female1.prefab b/SSLR/Assets/NpcModels/Prefabs/female1.prefab index d6554b7..e2f51c8 100644 --- a/SSLR/Assets/NpcModels/Prefabs/female1.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/female1.prefab @@ -674,7 +674,7 @@ Transform: m_GameObject: {fileID: 3556498266740698296} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/female2.prefab b/SSLR/Assets/NpcModels/Prefabs/female2.prefab index be669db..2649ca5 100644 --- a/SSLR/Assets/NpcModels/Prefabs/female2.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/female2.prefab @@ -268,7 +268,7 @@ Transform: m_GameObject: {fileID: 1785374020187378694} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/female3.prefab b/SSLR/Assets/NpcModels/Prefabs/female3.prefab index b434ee3..2ce55c5 100644 --- a/SSLR/Assets/NpcModels/Prefabs/female3.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/female3.prefab @@ -1117,7 +1117,7 @@ Transform: m_GameObject: {fileID: 7694716630882756943} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male1.prefab b/SSLR/Assets/NpcModels/Prefabs/male1.prefab index 3887783..c6d8c41 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male1.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male1.prefab @@ -402,7 +402,7 @@ Transform: m_GameObject: {fileID: 6305475373166175447} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male2.prefab b/SSLR/Assets/NpcModels/Prefabs/male2.prefab index 71b768a..c4d005e 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male2.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male2.prefab @@ -983,7 +983,7 @@ Transform: m_GameObject: {fileID: 4476012752627612937} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male3.prefab b/SSLR/Assets/NpcModels/Prefabs/male3.prefab index 2f26a0d..0af0aff 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male3.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male3.prefab @@ -1117,7 +1117,7 @@ Transform: m_GameObject: {fileID: 9182391001311392250} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male4.prefab b/SSLR/Assets/NpcModels/Prefabs/male4.prefab index 5736920..310a5d4 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male4.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male4.prefab @@ -29,7 +29,7 @@ Transform: m_GameObject: {fileID: 1101133743960231593} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male5.prefab b/SSLR/Assets/NpcModels/Prefabs/male5.prefab index af5e5be..5063c85 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male5.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male5.prefab @@ -313,7 +313,7 @@ Transform: m_GameObject: {fileID: 834682010213193268} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male6.prefab b/SSLR/Assets/NpcModels/Prefabs/male6.prefab index b0e6f84..044fe8f 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male6.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male6.prefab @@ -533,7 +533,7 @@ Transform: m_GameObject: {fileID: 4081393121370720058} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/NpcModels/Prefabs/male7.prefab b/SSLR/Assets/NpcModels/Prefabs/male7.prefab index 0d274f0..cb5a19d 100644 --- a/SSLR/Assets/NpcModels/Prefabs/male7.prefab +++ b/SSLR/Assets/NpcModels/Prefabs/male7.prefab @@ -29,7 +29,7 @@ Transform: m_GameObject: {fileID: 102797962149389305} serializedVersion: 2 m_LocalRotation: {x: -0, y: 1, z: -0, w: -0.00000016391276} - m_LocalPosition: {x: -0.4565086, y: 0.818, z: 0.474} + m_LocalPosition: {x: -0.4565086, y: 0.918, z: 0.474} m_LocalScale: {x: 0.45396, y: 0.01469, z: 0.57689} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/SSLR/Assets/Scenes/LiviPlayground.unity b/SSLR/Assets/Scenes/LiviPlayground.unity index 200c697..85e5e9f 100644 --- a/SSLR/Assets/Scenes/LiviPlayground.unity +++ b/SSLR/Assets/Scenes/LiviPlayground.unity @@ -5697,7 +5697,9 @@ MonoBehaviour: - SeatObject: {fileID: 14863571} Available: 1 currentNpcs: [] - despawnPoints: [] + despawnPoints: + - {fileID: 849138917} + - {fileID: 1742359896} desk: {fileID: 1068269875} --- !u!114 &520849220 MonoBehaviour: @@ -6804,7 +6806,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 0bab791ccf13189449b82b8f0b70b269, type: 3} m_Name: m_EditorClassIdentifier: - shiftDuration: 60 + shiftDuration: 120 npcSpawnArea: {fileID: 1126609776} --- !u!1 &741702766 GameObject: @@ -7839,6 +7841,37 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 836290519} m_CullTransparentMesh: 1 +--- !u!1 &849138916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 849138917} + m_Layer: 0 + m_Name: Left Despawn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &849138917 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849138916} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -2.554, y: 0.736, z: -0.557} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &883953354 GameObject: m_ObjectHideFlags: 0 @@ -17738,6 +17771,37 @@ MonoBehaviour: m_IgnoreFromBuild: 0 m_ApplyToChildren: 1 m_AffectedAgents: ffffffff +--- !u!1 &1742359895 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1742359896} + m_Layer: 0 + m_Name: Right Despawn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1742359896 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1742359895} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 2.192, y: 0.736, z: -0.557} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1752294637 GameObject: m_ObjectHideFlags: 0 @@ -21093,7 +21157,7 @@ MonoBehaviour: m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine m_IntArgument: 0 m_FloatArgument: 0 - m_StringArgument: Comcare + m_StringArgument: ComCare m_BoolArgument: 0 m_CallState: 2 --- !u!114 &2143047717 @@ -21347,3 +21411,5 @@ SceneRoots: - {fileID: 1399971910} - {fileID: 43707400} - {fileID: 1468703799} + - {fileID: 849138917} + - {fileID: 1742359896} diff --git a/SSLR/Assets/Scripts/NPCMovementRework.cs b/SSLR/Assets/Scripts/NPCMovementRework.cs index ae176a3..255a4ba 100644 --- a/SSLR/Assets/Scripts/NPCMovementRework.cs +++ b/SSLR/Assets/Scripts/NPCMovementRework.cs @@ -228,6 +228,13 @@ public class NpcMovementRework : MonoBehaviour npcClarifiedResponse.text = "I see..."; PlayerDialogueInteraction.instance.SetPlayerQuestions(npcData.question1, npcData.question2, npcData.question3); - PlayerDialogueInteraction.instance.SetPlayerResposne(npcData.response3); + PlayerDialogueInteraction.instance.SetPlayerResponse(npcData.response3); + } + + public void EndDialogue() + { + npcSpeechBubble.SetActive(false); + npcAnswerPanel.SetActive(false); + PlayerDialogueInteraction.instance.playerDialogue.SetActive(false); } } \ No newline at end of file diff --git a/SSLR/Assets/Scripts/NextButton.cs b/SSLR/Assets/Scripts/NextButton.cs index b2d116a..0ce5b76 100644 --- a/SSLR/Assets/Scripts/NextButton.cs +++ b/SSLR/Assets/Scripts/NextButton.cs @@ -14,10 +14,15 @@ public class NextButton : MonoBehaviour /// public void CallNext() { - var npcs = NpcManager.instance.currentNpcs; - var randomnpc = npcs[Random.Range(0, npcs.Count)]; - - GameManager.instance.SetCurrentNPC(randomnpc); - randomnpc.GetComponent().Called(); + if(GameManager.instance.currentNPC == null) + { + var npcs = NpcManager.instance.currentNpcs; + var randomnpc = npcs[Random.Range(0, npcs.Count)]; + + GameManager.instance.SetCurrentNPC(randomnpc); + randomnpc.GetComponent().Called(); + + PlayerDialogueInteraction.instance.ResetChecklist(); + } } } diff --git a/SSLR/Assets/Scripts/PaperSocket.cs b/SSLR/Assets/Scripts/PaperSocket.cs index 58c866f..77eabf3 100644 --- a/SSLR/Assets/Scripts/PaperSocket.cs +++ b/SSLR/Assets/Scripts/PaperSocket.cs @@ -71,6 +71,11 @@ public class PaperSocket : MonoBehaviour Debug.Log(paperDepartment); Destroy(paperObject); + + GameManager.instance.currentNPC.GetComponent().EndDialogue(); + + GameManager.instance.currentNPC.GetComponent().Despawn(); + GameManager.instance.currentNPC = null; } else { diff --git a/SSLR/Assets/Scripts/PlayerDialogueInteraction.cs b/SSLR/Assets/Scripts/PlayerDialogueInteraction.cs index 41515b8..3abaa21 100644 --- a/SSLR/Assets/Scripts/PlayerDialogueInteraction.cs +++ b/SSLR/Assets/Scripts/PlayerDialogueInteraction.cs @@ -42,14 +42,10 @@ public class PlayerDialogueInteraction : MonoBehaviour public GameObject serviceTick; public GameObject takeDocumentsTick; public GameObject giveDocumentsTick; - - [Header("Services")] - /*public GameObject comcareServiceButton; - public GameObject fscServiceButton; - public GameObject peersServiceButton; - public GameObject transitionalSheltersServiceButton; - public GameObject cpsServiceButton; - public GameObject sgEnableServiceButton;*/ + + /// + /// Reference to current document + /// public GameObject currentDocument; /// @@ -115,7 +111,7 @@ public class PlayerDialogueInteraction : MonoBehaviour /// Assigning UI text from npcData /// /// - public void SetPlayerResposne(string response) + public void SetPlayerResponse(string response) { playerResponseText.text = response; } diff --git a/SSLR/Assets/Scripts/StampDocument.cs b/SSLR/Assets/Scripts/StampDocument.cs index b7dcaab..61a4097 100644 --- a/SSLR/Assets/Scripts/StampDocument.cs +++ b/SSLR/Assets/Scripts/StampDocument.cs @@ -42,7 +42,16 @@ public class StampDocument : MonoBehaviour /// public string CheckFinalDepartment() { - return $"{assignedDepartment}-{assignedService}"; + var paperDepartment = $"{assignedDepartment} - {assignedService}"; + + if (paperDepartment == GameManager.instance.currentNPCCorrectDepartment) + { + return "Correct"; + } + else + { + return "Wrong"; + } } /// @@ -67,6 +76,7 @@ public class StampDocument : MonoBehaviour isSigned = false; isStamped = false; } + /// /// Financial stamp appear, assign department and declare stamped @@ -118,42 +128,42 @@ public class StampDocument : MonoBehaviour case "ComCare": comcareSignature.SetActive(true); isSigned = true; - assignedDepartment = "ComCare"; + assignedService = "ComCare"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break; case "FSC": fscSignature.SetActive(true); isSigned = true; - assignedDepartment = "Family Service Centres"; + assignedService = "Family Service Centres"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break; case "PEERS": peersSignature.SetActive(true); isSigned = true; - assignedDepartment = "PEERS"; + assignedService = "PEERS"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break; case "Transitional Shelters": transitionalShelterSignature.SetActive(true); isSigned = true; - assignedDepartment = "Transitional Shelters"; + assignedService = "Transitional Shelters"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break; case "CPS": cpsSignature.SetActive(true); isSigned = true; - assignedDepartment = "CPS"; + assignedService = "CPS"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break; case "SG Enable": sgEnableSignature.SetActive(true); isSigned = true; - assignedDepartment = "SG Enable"; + assignedService = "SG Enable"; PlayerDialogueInteraction.instance.servicesPanel.SetActive(false); PlayerDialogueInteraction.instance.questionPanel.SetActive(true); break;