diff --git a/TTCS_Prot/Assets/Scenes/SampleScene.unity b/TTCS_Prot/Assets/Scenes/SampleScene.unity index 635570d5a46e81b6b1411e6331da833a0da5ae10..3581b9b5c57843b8760749f1edfa4861705e07be 100644 --- a/TTCS_Prot/Assets/Scenes/SampleScene.unity +++ b/TTCS_Prot/Assets/Scenes/SampleScene.unity @@ -5234,7 +5234,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 534669902} m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} - m_LocalPosition: {x: 1.5, y: 4.32, z: -21} + m_LocalPosition: {x: 1.5, y: 4.3, z: -1.1} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} @@ -7997,7 +7997,7 @@ MonoBehaviour: dialogue: Sure... I'm gonna go clean up inside. - thisEventType: 0 charName: T. Kelso - character: {fileID: 1997847393} + character: {fileID: 734794666} dialogueImage: {fileID: 0} dialogueTime: 0 isStatement: 0 @@ -8554,15 +8554,15 @@ MonoBehaviour: charName: Penelope character: {fileID: 734794666} dialogueImage: {fileID: 2800000, guid: 44e4b9f73e2c9604289adf9efd1106bc, type: 3} - dialogueTime: 0 - isStatement: 0 - statement: {fileID: 0} - endLocation: {x: -2.3, y: 0.5, z: 2} + dialogueTime: 4 + isStatement: 1 + statement: {fileID: 1997847404} + endLocation: {x: 1.4, y: 0, z: 0} speed: 0 zoomSpeed: 0 wait: 0 size: 0 - dialogue: + dialogue: Hey, so I'm gonna need to ask you a few questions... - thisEventType: 2 charName: Penelope character: {fileID: 0} @@ -8719,7 +8719,7 @@ MonoBehaviour: wait: 1 size: 4.143829 dialogue: I'm sorry. If you get my bill in the mail, ignore it. - description: Rabbit Ending; + description: Kelso Interrogation movementEvent: {fileID: 848200921} dialogueEvent: {fileID: 848200920} cameraEvent: {fileID: 848200919} @@ -12347,17 +12347,17 @@ PrefabInstance: - target: {fileID: 3761742374809534360, guid: f4ad175d0facffa459f806cdddc12632, type: 3} propertyPath: m_LocalPosition.x - value: -2.3096268 + value: -2.41 objectReference: {fileID: 0} - target: {fileID: 3761742374809534360, guid: f4ad175d0facffa459f806cdddc12632, type: 3} propertyPath: m_LocalPosition.y - value: 0.099999994 + value: 0 objectReference: {fileID: 0} - target: {fileID: 3761742374809534360, guid: f4ad175d0facffa459f806cdddc12632, type: 3} propertyPath: m_LocalPosition.z - value: 1.9600617 + value: 2.05 objectReference: {fileID: 0} - target: {fileID: 3761742374809534360, guid: f4ad175d0facffa459f806cdddc12632, type: 3} @@ -18719,6 +18719,18 @@ Transform: type: 3} m_PrefabInstance: {fileID: 2010493470} m_PrefabAsset: {fileID: 0} +--- !u!114 &1997847404 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 8063152740557189244, guid: 6ee8416312977a74a9ed6e38590dd947, + type: 3} + m_PrefabInstance: {fileID: 2010493470} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1997847393} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7044968a7b229444b86e62a9f40a778f, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!224 &2006776547 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 2143891401098949977, guid: 88755a80ecaefc648948195518c0b381, @@ -18740,17 +18752,17 @@ PrefabInstance: - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} propertyPath: m_LocalPosition.x - value: -0.5 + value: -1.25 objectReference: {fileID: 0} - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} propertyPath: m_LocalPosition.z - value: 1.33 + value: 1.29 objectReference: {fileID: 0} - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} @@ -18775,7 +18787,7 @@ PrefabInstance: - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} propertyPath: m_RootOrder - value: 1 + value: 0 objectReference: {fileID: 0} - target: {fileID: 8063152740557189240, guid: 6ee8416312977a74a9ed6e38590dd947, type: 3} diff --git a/TTCS_Prot/Assets/Scenes/example.meta b/TTCS_Prot/Assets/Scenes/example.meta new file mode 100644 index 0000000000000000000000000000000000000000..2938a2cad0bab059ab6924f712eacddea4253a87 --- /dev/null +++ b/TTCS_Prot/Assets/Scenes/example.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bebd874866a254106aae17e52a06ac6e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/TTCS_Prot/Assets/Scripts/Classes/InputManager.cs b/TTCS_Prot/Assets/Scripts/Classes/InputManager.cs index 8317860e88cfe4bc653dea55cc29056790712340..b2d0c1524ee994189188970ebea0a697c538f8df 100644 --- a/TTCS_Prot/Assets/Scripts/Classes/InputManager.cs +++ b/TTCS_Prot/Assets/Scripts/Classes/InputManager.cs @@ -10,6 +10,8 @@ public class InputManager : MonoBehaviour public List<RoomScript> _rooms; public List<WitnessScript> _witnesses; + DetectiveScript _detective; + // Start is called before the first frame update void Start() @@ -24,6 +26,7 @@ public class InputManager : MonoBehaviour _rooms.Add(r); } + _detective = FindObjectOfType<DetectiveScript>(); Object[] witnesses = FindObjectsOfType<WitnessScript>(); @@ -37,11 +40,6 @@ public class InputManager : MonoBehaviour // Update is called once per frame void Update() { - if(Input.GetMouseButtonDown(0)) - _selector.SelectBegin(); - - if (Input.GetMouseButtonUp(0)) - _selector.SelectEnd(); if(Input.GetMouseButtonDown(1)) { @@ -51,36 +49,29 @@ public class InputManager : MonoBehaviour void TestDetectiveCommand() { - if (_selector.selectedDetectives.Count == 1) - { - Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); - mousePos.y = 0.3f; + Vector3 mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition); + mousePos.y = 0.3f; - for(int i = 0; i < _witnesses.Count; i++) + for(int i = 0; i < _witnesses.Count; i++) + { + if (_witnesses[i].witnessCollider.bounds.Contains(mousePos) && _detective.State == 0) { - DetectiveScript d = _selector.selectedDetectives[0].GetComponent<DetectiveScript>(); - - if (_witnesses[i].witnessCollider.bounds.Contains(mousePos) && d.State == 0) - { - //Interrogate this witness; - d.Interrogate(_witnesses[i]); - return; - } + //Interrogate this witness; + _detective.Interrogate(_witnesses[i]); + return; } - mousePos.y = 0.0f; + } + mousePos.y = 0.0f; - for (int i = 0; i < _rooms.Count; i++) + for (int i = 0; i < _rooms.Count; i++) + { + for (int j = 0; j < _rooms[i].roomCollider.Length; j++) { - DetectiveScript d = _selector.selectedDetectives[0].GetComponent<DetectiveScript>(); - - for (int j = 0; j < _rooms[i].roomCollider.Length; j++) + if (_rooms[i].roomCollider[j].bounds.Contains(mousePos) && _detective.State == 0 && !_rooms[i].searched) { - if (_rooms[i].roomCollider[j].bounds.Contains(mousePos) && d.State == 0 && !_rooms[i].searched) - { - //Search this room. - d.SearchRoom(_rooms[i]); - return; - } + //Search this room. + _detective.SearchRoom(_rooms[i]); + return; } } } diff --git a/TTCS_Prot/Assets/example.meta b/TTCS_Prot/Assets/example.meta new file mode 100644 index 0000000000000000000000000000000000000000..2cb0640099e2dab509e40ee97df215b3b2419557 --- /dev/null +++ b/TTCS_Prot/Assets/example.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1c66af92d50784d799545bc86c9b8590 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: