From 54db4e4b7387938b5856ee5597915d1bfc2e67c1 Mon Sep 17 00:00:00 2001 From: Trey Shaw Date: Sat, 11 Apr 2026 18:34:16 -0500 Subject: [PATCH] add doug to dialogue, start grandma quest --- Assets/BouncyBall.physicMaterial | 15 + Assets/BouncyBall.physicMaterial.meta | 8 + Assets/Doug.prefab | 284 +++++++++- Assets/RubberBall.prefab | 142 +++++ Assets/RubberBall.prefab.meta | 7 + Assets/Scenes/SampleScene.unity | 499 +++++++++++++++++- Assets/Scripts/Dialogue/Dialogue.cs | 13 +- Assets/Scripts/Dialogue/DialogueManager.cs | 60 ++- .../PlayerController.cs | 5 +- .../PlayerController.cs.meta | 0 Assets/Scripts/Management/Questing/Quest.cs | 6 +- .../Management/Questing/QuestRegistry.cs | 30 ++ .../Scripts/Management/Questing/Storybools.cs | 4 + Assets/Scripts/Tools/Ballgun.cs | 27 + Assets/Scripts/Tools/Ballgun.cs.meta | 2 + 15 files changed, 1049 insertions(+), 53 deletions(-) create mode 100644 Assets/BouncyBall.physicMaterial create mode 100644 Assets/BouncyBall.physicMaterial.meta create mode 100644 Assets/RubberBall.prefab create mode 100644 Assets/RubberBall.prefab.meta rename Assets/Scripts/{Dialogue => Management}/PlayerController.cs (98%) rename Assets/Scripts/{Dialogue => Management}/PlayerController.cs.meta (100%) create mode 100644 Assets/Scripts/Tools/Ballgun.cs create mode 100644 Assets/Scripts/Tools/Ballgun.cs.meta diff --git a/Assets/BouncyBall.physicMaterial b/Assets/BouncyBall.physicMaterial new file mode 100644 index 0000000..ceb9cf1 --- /dev/null +++ b/Assets/BouncyBall.physicMaterial @@ -0,0 +1,15 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!134 &13400000 +PhysicsMaterial: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BouncyBall + serializedVersion: 2 + m_DynamicFriction: 0.6 + m_StaticFriction: 0.6 + m_Bounciness: 1 + m_FrictionCombine: 0 + m_BounceCombine: 0 diff --git a/Assets/BouncyBall.physicMaterial.meta b/Assets/BouncyBall.physicMaterial.meta new file mode 100644 index 0000000..69853a3 --- /dev/null +++ b/Assets/BouncyBall.physicMaterial.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e11a0c91449cb044686c17715bd96f92 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 13400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Doug.prefab b/Assets/Doug.prefab index e20ce39..95bd13f 100644 --- a/Assets/Doug.prefab +++ b/Assets/Doug.prefab @@ -112,6 +112,118 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &709887693209667375 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4278124706789863400} + - component: {fileID: 4914282159127492672} + - component: {fileID: 8708068185639895676} + - component: {fileID: 8705898766560518383} + m_Layer: 0 + m_Name: Graphics + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4278124706789863400 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709887693209667375} + serializedVersion: 2 + m_LocalRotation: {x: 0.45486292, y: 0.47949305, z: 0.51648575, w: 0.54445267} + m_LocalPosition: {x: 0.127, y: 0.041000016, z: -0.06199996} + m_LocalScale: {x: 0.063083, y: 0.06308299, z: 0.030040754} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5562995395109305721} + m_LocalEulerAnglesHint: {x: 0, y: 82.74, z: 86.98} +--- !u!33 &4914282159127492672 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709887693209667375} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &8708068185639895676 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709887693209667375} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &8705898766560518383 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 709887693209667375} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &826694479434819953 GameObject: m_ObjectHideFlags: 0 @@ -368,6 +480,7 @@ Transform: - {fileID: 6959836037467520223} - {fileID: 7557613548437949332} - {fileID: 4497923176373106572} + - {fileID: 5562995395109305721} m_Father: {fileID: 5056434560497563343} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1125603919066053951 @@ -1491,6 +1604,58 @@ MonoBehaviour: altUseTimeSec: 0 inUse: 0 lightSrc: {fileID: 2715587763268303228} +--- !u!1 &4598830105873239343 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5562995395109305721} + - component: {fileID: 5907675754202653673} + m_Layer: 0 + m_Name: BallGun + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &5562995395109305721 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4598830105873239343} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4278124706789863400} + - {fileID: 1687079168721776906} + m_Father: {fileID: 6581087177990818461} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5907675754202653673 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4598830105873239343} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8adaf1de0b489444189e21893ccde9b5, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Ballgun + useTimeSec: 0 + altUseTimeSec: 0 + inUse: 0 + shootForce: 10 + testBall: {fileID: 7664016258760507437, guid: 0b0365667a94c474bb3cc42312aac1db, type: 3} + ballLifeTime: 5 --- !u!1 &4672178086213347511 GameObject: m_ObjectHideFlags: 0 @@ -1989,6 +2154,118 @@ BoxCollider: serializedVersion: 3 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &6169192211327620812 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1687079168721776906} + - component: {fileID: 18103524240907197} + - component: {fileID: 7570600903363991136} + - component: {fileID: 3425536097262147217} + m_Layer: 0 + m_Name: Graphics (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1687079168721776906 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169192211327620812} + serializedVersion: 2 + m_LocalRotation: {x: 0.45486292, y: 0.47949305, z: 0.51648575, w: 0.54445267} + m_LocalPosition: {x: 0.1214, y: 0.0776, z: -0.0206} + m_LocalScale: {x: 0.033143807, y: 0.15052864, z: 0.030040754} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5562995395109305721} + m_LocalEulerAnglesHint: {x: 0, y: 82.74, z: 86.98} +--- !u!33 &18103524240907197 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169192211327620812} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7570600903363991136 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169192211327620812} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &3425536097262147217 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6169192211327620812} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} --- !u!1 &6233083279635182816 GameObject: m_ObjectHideFlags: 0 @@ -2470,9 +2747,12 @@ MonoBehaviour: - {fileID: 948123141231275876} - {fileID: 2884873557578242522} - {fileID: 6033266832729015012} + - {fileID: 5907675754202653673} walkSpeed: 2 sprintMultiplier: 1.5 - gravity: 10 + gravity: 1 + jumpForce: 8.01 + jumpTime: 0.5 --- !u!114 &5478143440182735446 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2521,7 +2801,7 @@ CharacterController: m_SlopeLimit: 45 m_StepOffset: 0.3 m_SkinWidth: 0.03 - m_MinMoveDistance: 0.001 + m_MinMoveDistance: 0 m_Center: {x: 0, y: -0.51, z: 0} --- !u!1 &9105254285813222465 GameObject: diff --git a/Assets/RubberBall.prefab b/Assets/RubberBall.prefab new file mode 100644 index 0000000..1081ada --- /dev/null +++ b/Assets/RubberBall.prefab @@ -0,0 +1,142 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7664016258760507437 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1726613362671065430} + - component: {fileID: 1753263962729783047} + - component: {fileID: 6205312924763433350} + - component: {fileID: 7350486210546925347} + - component: {fileID: 2968305615973019778} + m_Layer: 0 + m_Name: RubberBall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1726613362671065430 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7664016258760507437} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.327, y: 3.81, z: -2.626} + m_LocalScale: {x: 0.089599, y: 0.089599, z: 0.089599} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1753263962729783047 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7664016258760507437} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &6205312924763433350 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7664016258760507437} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &7350486210546925347 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7664016258760507437} + m_Material: {fileID: 13400000, guid: e11a0c91449cb044686c17715bd96f92, type: 2} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!54 &2968305615973019778 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7664016258760507437} + serializedVersion: 5 + m_Mass: 1 + m_LinearDamping: 0 + m_AngularDamping: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 0 + m_CollisionDetection: 0 diff --git a/Assets/RubberBall.prefab.meta b/Assets/RubberBall.prefab.meta new file mode 100644 index 0000000..0b7d3ac --- /dev/null +++ b/Assets/RubberBall.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b0365667a94c474bb3cc42312aac1db +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 8da15ad..2b2ac27 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -1166,7 +1166,8 @@ MonoBehaviour: charName: Sam Ballman isActive: 0 sentences: - - Hey, Doug. + - isDoug: 0 + line: Hey Doug, good to see you. voice: {fileID: 0} talkIndicator: {fileID: 1356554487} quests: @@ -1606,6 +1607,170 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 343477992} m_CullTransparentMesh: 1 +--- !u!1 &371361797 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 371361803} + - component: {fileID: 371361802} + - component: {fileID: 371361801} + - component: {fileID: 371361800} + - component: {fileID: 371361799} + - component: {fileID: 371361798} + m_Layer: 0 + m_Name: Grandma + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!135 &371361798 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Radius: 3.19 + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &371361799 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9a63e353faf59ff4aac9a348dfdca9dc, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::DialogueVoice + talkSpeed: 0.96 + speechInterval: 2 + voice: 2 +--- !u!114 &371361800 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e85641f45d2eb9b458bbba38374b1360, type: 3} + m_Name: + m_EditorClassIdentifier: + defaultDialogue: + charName: Grandma + isActive: 0 + sentences: + - isDoug: 0 + line: Hi, dear. + voice: {fileID: 0} + talkIndicator: {fileID: 1495660516} + quests: + - {fileID: 1843688238} +--- !u!23 &371361801 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &371361802 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &371361803 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 371361797} + serializedVersion: 2 + m_LocalRotation: {x: -0.0007883741, y: 0.0012165046, z: -0.0015583121, w: 0.99999774} + m_LocalPosition: {x: 10.801, y: 3.6573, z: 4.404} + m_LocalScale: {x: 0.12264277, y: 0.12264277, z: 0.12264277} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1843688239} + - {fileID: 1495660517} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: -0.09, y: 0.14, z: -0.179} +--- !u!114 &373047378 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 5907675754202653673, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} + m_PrefabInstance: {fileID: 7959480261809233915} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8adaf1de0b489444189e21893ccde9b5, type: 3} + m_Name: + m_EditorClassIdentifier: Assembly-CSharp::Ballgun --- !u!1 &410087039 GameObject: m_ObjectHideFlags: 0 @@ -2390,12 +2555,20 @@ MonoBehaviour: hasStarted: 0 hasCompleted: 0 askText: - - Hey Doug, I need your help. - - Could you grab 3 star shards and touch the cube over there? + - isDoug: 0 + line: Hey Doug! + - isDoug: 1 + line: What's up? + - isDoug: 0 + line: Can you fetch me 3 star shards and touch that cube over there? duringText: - - 'Remember: 3 star shards and touch the cube over there.' + - isDoug: 1 + line: What do I need to do again? + - isDoug: 0 + line: I need 3 star shards, and I need you to touch that cube. completionText: - - Thanks for your help, Doug! + - isDoug: 0 + line: Thanks Doug! questID: 1 --- !u!4 &462221472 Transform: @@ -3460,6 +3633,96 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 813193271} m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &820829147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 820829148} + - component: {fileID: 820829150} + - component: {fileID: 820829149} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &820829148 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820829147} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.7086396, y: 2.69, z: -5.30192} + m_LocalScale: {x: 0.18261741, y: 0.1826174, z: 0.18261741} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1495660517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &820829149 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820829147} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &820829150 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820829147} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &832575517 GameObject: m_ObjectHideFlags: 0 @@ -3509,6 +3772,96 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &839655231 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 839655232} + - component: {fileID: 839655234} + - component: {fileID: 839655233} + m_Layer: 0 + m_Name: Capsule + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &839655232 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 839655231} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.7086396, y: 3.117, z: -5.30192} + m_LocalScale: {x: 0.18261741, y: 0.25838536, z: 0.18261741} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1495660517} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &839655233 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 839655231} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_ForceMeshLod: -1 + m_MeshLodSelectionBias: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_GlobalIlluminationMeshLod: 0 + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_MaskInteraction: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &839655234 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 839655231} + m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &902781401 GameObject: m_ObjectHideFlags: 0 @@ -5615,17 +5968,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 46.475, z: 0} ---- !u!114 &1446259105 stripped -MonoBehaviour: - m_CorrespondingSourceObject: {fileID: 6033266832729015012, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} - m_PrefabInstance: {fileID: 7959480261809233915} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe5aedf75d904534296ad0d07fe55622, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Throwable --- !u!1 &1475998728 GameObject: m_ObjectHideFlags: 0 @@ -5763,6 +6105,39 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1475998728} m_CullTransparentMesh: 1 +--- !u!1 &1495660516 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1495660517} + m_Layer: 0 + m_Name: Exclamation + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1495660517 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1495660516} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.7086396, y: -1.7700001, z: 5.30192} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 820829148} + - {fileID: 839655232} + m_Father: {fileID: 371361803} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1502779279 PrefabInstance: m_ObjectHideFlags: 0 @@ -6674,6 +7049,77 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1739342000} m_CullTransparentMesh: 1 +--- !u!1 &1843688237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1843688239} + - component: {fileID: 1843688238} + m_Layer: 0 + m_Name: Quest2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1843688238 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843688237} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2db38219bed101e44b995a3611e4cedd, type: 3} + m_Name: + m_EditorClassIdentifier: + hasStarted: 0 + hasCompleted: 0 + askText: + - isDoug: 0 + line: Hi there, Doug. + - isDoug: 0 + line: I know you're having a hard time lately... but I could really use your + help around here. + - isDoug: 1 + line: What can I do? + - isDoug: 0 + line: 'The shopkeeper in town. He tells me he could use your digging skills. ' + - isDoug: 1 + line: 'I''m not an excavator, and I don''t want to be one. ' + - isDoug: 0 + line: 'Doug, you''re another mouth to feed. It doesn''t have to be a career. + We just need some more money around here. ' + - isDoug: 1 + line: 'Alright. I''ll talk to him. ' + duringText: + - isDoug: 0 + line: Go talk to the shopkeeper in town. He's got some freelance work for you. + completionText: + - isDoug: 0 + line: I hear you did a great job for the shopkeeper. I hope you continue to take + him up on his generous offer... + questID: 2 +--- !u!4 &1843688239 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843688237} + serializedVersion: 2 + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 371361803} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1854015637 GameObject: m_ObjectHideFlags: 0 @@ -7934,13 +8380,17 @@ PrefabInstance: m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 1480974628599415149, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} - propertyPath: tools.Array.size - value: 3 + propertyPath: gravity + value: 1 objectReference: {fileID: 0} - target: {fileID: 1480974628599415149, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} - propertyPath: 'tools.Array.data[2]' + propertyPath: tools.Array.size + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 1480974628599415149, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} + propertyPath: 'tools.Array.data[3]' value: - objectReference: {fileID: 1446259105} + objectReference: {fileID: 373047378} - target: {fileID: 5526037850913171920, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} propertyPath: m_LocalPosition.x value: -0.60945 @@ -7981,6 +8431,14 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 5907675754202653673, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} + propertyPath: ball + value: + objectReference: {fileID: 7664016258760507437, guid: 0b0365667a94c474bb3cc42312aac1db, type: 3} + - target: {fileID: 8111368525007731252, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} + propertyPath: m_MinMoveDistance + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9054701043111961555, guid: 0fd9b22e9158e474a96c42de5ee0d85f, type: 3} propertyPath: m_Name value: Doug @@ -8003,6 +8461,7 @@ SceneRoots: - {fileID: 7959480261809233915} - {fileID: 430850203} - {fileID: 265036979} + - {fileID: 371361803} - {fileID: 1892268943} - {fileID: 1502779279} - {fileID: 1854015638} diff --git a/Assets/Scripts/Dialogue/Dialogue.cs b/Assets/Scripts/Dialogue/Dialogue.cs index 816bb6d..ebc7b3d 100644 --- a/Assets/Scripts/Dialogue/Dialogue.cs +++ b/Assets/Scripts/Dialogue/Dialogue.cs @@ -6,6 +6,15 @@ public class Dialogue public string charName; public bool isActive = false; - [TextArea(3,10)] - public string[] sentences; + public DialogueLine[] sentences; +} + +[System.Serializable] +public class DialogueLine +{ + // is Doug or the character talking? Let's convo have 2 sides + public bool isDoug; + + [TextArea(3, 10)] + public string line; } diff --git a/Assets/Scripts/Dialogue/DialogueManager.cs b/Assets/Scripts/Dialogue/DialogueManager.cs index 7540ca1..8010029 100644 --- a/Assets/Scripts/Dialogue/DialogueManager.cs +++ b/Assets/Scripts/Dialogue/DialogueManager.cs @@ -5,7 +5,7 @@ public class DialogueManager : MonoBehaviour { - private Queue sentences; + private Queue sentences; private Dialogue currentDialogue; private DialogueVoice currentDialogueVoice; private float maxDialogueWaitTime = 1.0f; @@ -25,7 +25,7 @@ public class DialogueManager : MonoBehaviour // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { - sentences = new Queue(); + sentences = new Queue(); voiceSourcePool = GetComponentsInChildren(); } @@ -45,9 +45,8 @@ public void StartDialogue(Dialogue dialogue, DialogueVoice dialogueVoice) sentences.Clear(); currentDialogue = dialogue; currentDialogueVoice = dialogueVoice; - nameText.text = dialogue.charName; - foreach (string sentence in dialogue.sentences) + foreach (DialogueLine sentence in dialogue.sentences) { sentences.Enqueue(sentence); } @@ -64,7 +63,7 @@ public void DisplayNextSentence() return; } - string sentence = sentences.Dequeue(); + DialogueLine sentence = sentences.Dequeue(); StopAllCoroutines(); StopVoices(); StartCoroutine(TypeSentence(sentence)); @@ -82,34 +81,51 @@ public void EndDialogue() } } - IEnumerator TypeSentence(string sentence) + IEnumerator TypeSentence(DialogueLine sentence) { dialogueText.text = ""; - char[] sentenceCharArray = sentence.ToCharArray(); + + if (sentence.isDoug) + { + nameText.text = "Doug"; + } + else + { + nameText.text = currentDialogue.charName; + } + + char[] sentenceCharArray = sentence.line.ToCharArray(); for (int i = 0; i < sentenceCharArray.Length; i++) { dialogueText.text += sentenceCharArray[i]; - if (currentDialogueVoice != null && currentDialogueVoice.voice != Voices.None) + if (sentence.isDoug) { - if (i % currentDialogueVoice.speechInterval == 0) - { - AudioClip voiceToPlay = currentDialogueVoice.GetClipFromChar(char.ToLower(sentenceCharArray[i])); - - if (voiceToPlay != null) - { - PlayNextClip(voiceToPlay); - } - } - - yield return new WaitForSeconds(maxDialogueWaitTime - currentDialogueVoice.talkSpeed * maxDialogueWaitTime); + // TODO: Add Doug voice + yield return new WaitForSeconds(0.03f); } else { - // TODO: Add speed variable to non-voices (Talkable.cs) - yield return new WaitForSeconds(0.03f); + if (currentDialogueVoice != null && currentDialogueVoice.voice != Voices.None) + { + if (i % currentDialogueVoice.speechInterval == 0) + { + AudioClip voiceToPlay = currentDialogueVoice.GetClipFromChar(char.ToLower(sentenceCharArray[i])); + + if (voiceToPlay != null) + { + PlayNextClip(voiceToPlay); + } + } + + yield return new WaitForSeconds(maxDialogueWaitTime - currentDialogueVoice.talkSpeed * maxDialogueWaitTime); + } + else + { + // TODO: Add speed variable to non-voices (Talkable.cs) + yield return new WaitForSeconds(0.03f); + } } - } } diff --git a/Assets/Scripts/Dialogue/PlayerController.cs b/Assets/Scripts/Management/PlayerController.cs similarity index 98% rename from Assets/Scripts/Dialogue/PlayerController.cs rename to Assets/Scripts/Management/PlayerController.cs index e10fb28..debd3e1 100644 --- a/Assets/Scripts/Dialogue/PlayerController.cs +++ b/Assets/Scripts/Management/PlayerController.cs @@ -135,10 +135,7 @@ void ApplyGravity() else moveDir *= walkSpeed; - if (!characterController.isGrounded) - { - moveDir.y = -gravity; - } + moveDir.y += -gravity; } /// diff --git a/Assets/Scripts/Dialogue/PlayerController.cs.meta b/Assets/Scripts/Management/PlayerController.cs.meta similarity index 100% rename from Assets/Scripts/Dialogue/PlayerController.cs.meta rename to Assets/Scripts/Management/PlayerController.cs.meta diff --git a/Assets/Scripts/Management/Questing/Quest.cs b/Assets/Scripts/Management/Questing/Quest.cs index 4a74826..f1cc067 100644 --- a/Assets/Scripts/Management/Questing/Quest.cs +++ b/Assets/Scripts/Management/Questing/Quest.cs @@ -5,9 +5,9 @@ public class Quest : MonoBehaviour public bool hasStarted = false; public bool hasCompleted = false; - public string[] askText; // ask the player to complete the task - public string[] duringText; // what to say to the player when the task is complete - public string[] completionText; // what to say to the player upon completion + public DialogueLine[] askText; // ask the player to complete the task + public DialogueLine[] duringText; // what to say to the player when the task is complete + public DialogueLine[] completionText; // what to say to the player upon completion public int questID = 0; // connects the quest to the registry, which gives us conditions diff --git a/Assets/Scripts/Management/Questing/QuestRegistry.cs b/Assets/Scripts/Management/Questing/QuestRegistry.cs index 068a352..8548d58 100644 --- a/Assets/Scripts/Management/Questing/QuestRegistry.cs +++ b/Assets/Scripts/Management/Questing/QuestRegistry.cs @@ -53,6 +53,36 @@ private void Awake() questBoolMap.Add(1, QID1_List); #endregion + #region 2 - (Story Quest #1) No More Freeloading + // This is the first time we talk to grandma. She wants help around the house. + // Quest is complete after we talk to the shop keeper and complete quest 3. + + QuestBool[] QID2_List = new QuestBool[1]; + + // QID2_1_completedQuest3 + QID1_List[0] = new QuestBool(() => + { + return CompletedQuests.Contains(3); + }); + + questBoolMap.Add(2, QID1_List); + #endregion + + #region 3 - (Story Quest #1.5) First Paycheck + // This is the first time we talk to the shopkeeper. He tells us to find a star + // shard and bring it to him. + + QuestBool[] QID3_List = new QuestBool[1]; + + // QID3_1_hasEnoughStarshards + QID1_List[0] = new QuestBool(() => + { + return GameManager.Instance.Inventory.GetItemQuantity(ItemIdEnum.STAR_SHARD) > 0; + }); + + questBoolMap.Add(3, QID1_List); + #endregion + return questBoolMap; } diff --git a/Assets/Scripts/Management/Questing/Storybools.cs b/Assets/Scripts/Management/Questing/Storybools.cs index 5349d8d..7fd38f8 100644 --- a/Assets/Scripts/Management/Questing/Storybools.cs +++ b/Assets/Scripts/Management/Questing/Storybools.cs @@ -7,4 +7,8 @@ public class Storybools #region QID1 public bool hasHelpedSam = false; #endregion + + #region QID3 + public bool talkedToShopkeep = false; + #endregion } diff --git a/Assets/Scripts/Tools/Ballgun.cs b/Assets/Scripts/Tools/Ballgun.cs new file mode 100644 index 0000000..2773636 --- /dev/null +++ b/Assets/Scripts/Tools/Ballgun.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +public class Ballgun : Tool +{ + [Header("Ball Gun Parameters")] + public float shootForce = 10; + public GameObject ball; + public float ballLifeTime = 5; + + public override void Use() + { + GameObject newBall = Instantiate(ball); + newBall.transform.position = transform.position; + + Vector3 direction = transform.forward * shootForce; + direction += GameManager.Instance.GetPlayerController().GetVelocity(); + + newBall.GetComponent().AddForce(direction, ForceMode.Impulse); + + Destroy(newBall, ballLifeTime); + } + + public override void UseAlt() + { + throw new System.NotImplementedException(); + } +} diff --git a/Assets/Scripts/Tools/Ballgun.cs.meta b/Assets/Scripts/Tools/Ballgun.cs.meta new file mode 100644 index 0000000..50bfa10 --- /dev/null +++ b/Assets/Scripts/Tools/Ballgun.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8adaf1de0b489444189e21893ccde9b5 \ No newline at end of file