From a54ce69e6699694369f7329780714263204004bc Mon Sep 17 00:00:00 2001 From: Valdimir Date: Tue, 28 Feb 2023 23:41:38 +0200 Subject: [PATCH] simple eating ) --- Assets/Scenes/TestRoom.unity | 477 +----------------- .../DialogueSystem/ConversationController.cs | 6 +- .../InteractableObjects/ColaFreezer.cs | 1 + Assets/Scripts/InteractableObjects/Fridge.cs | 14 +- Assets/Scripts/Player/Player.cs | 18 +- Assets/Scripts/Player/PlayerStats.cs | 12 +- Assets/Scripts/Player/Stat.cs | 19 +- Assets/Scripts/ScriptableObjects/Cola.asset | 2 +- Assets/Scripts/TimeManager.cs | 10 +- 9 files changed, 58 insertions(+), 501 deletions(-) diff --git a/Assets/Scenes/TestRoom.unity b/Assets/Scenes/TestRoom.unity index 5ab0d4df..dda53134 100644 --- a/Assets/Scenes/TestRoom.unity +++ b/Assets/Scenes/TestRoom.unity @@ -37,8 +37,8 @@ RenderSettings: m_ReflectionBounces: 1 m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} - m_Sun: {fileID: 705507994} - m_IndirectSpecularColor: {r: 0.1826001, g: 0.22831085, b: 0.30717328, a: 1} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.17276844, g: 0.21589246, b: 0.2978263, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -365,37 +365,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 65520548} m_Mesh: {fileID: 1720402882065375157, guid: 0d817475ce7adaa4f81fbdb111b8599c, type: 3} ---- !u!1 &94928690 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 94928691} - m_Layer: 0 - m_Name: PathElement (2) - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &94928691 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 94928690} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -3.4562478, y: 2.476255, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &100072732 GameObject: m_ObjectHideFlags: 0 @@ -427,66 +396,6 @@ Transform: m_Father: {fileID: 215962541} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &101167829 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 101167831} - - component: {fileID: 101167830} - m_Layer: 7 - m_Name: Path - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &101167830 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 101167829} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: bcc540dae28291b498a66c667c22bc3a, type: 3} - m_Name: - m_EditorClassIdentifier: - PathType: 1 - movementDirection: 1 - movingTo: 0 - PathElements: - - {fileID: 898537619} - - {fileID: 1182335881} - - {fileID: 94928691} - - {fileID: 1791787533} - - {fileID: 1152324441} - - {fileID: 1382752553} ---- !u!4 &101167831 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 101167829} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.1737524, y: 0.52, z: -17.134588} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 898537619} - - {fileID: 1182335881} - - {fileID: 94928691} - - {fileID: 1791787533} - - {fileID: 1152324441} - - {fileID: 1382752553} - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &215962540 GameObject: m_ObjectHideFlags: 0 @@ -855,7 +764,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: _startHour: 9 - _sunLight: {fileID: 705507994} _sunriseHour: 7 _sunsetHour: 20.5 _minuteToRealTime: 0.5 @@ -867,7 +775,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 307039698} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -66.86987, y: -30.572754, z: 45.03262} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1563,100 +1471,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 696070341} m_Mesh: {fileID: 1744877714637898952, guid: 0d817475ce7adaa4f81fbdb111b8599c, type: 3} ---- !u!1 &705507993 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 705507995} - - component: {fileID: 705507994} - m_Layer: 0 - m_Name: Sunlight - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!108 &705507994 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 705507993} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 2 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 0.8 - m_Bias: 0.05 - m_NormalBias: 0 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!4 &705507995 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 705507993} - m_LocalRotation: {x: 0.13156042, y: 0.92744404, z: -0.34980756, w: -0.013194327} - m_LocalPosition: {x: 0, y: 50, z: 50} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1504187455} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 40.194, y: 188.774, z: 19.363} --- !u!1 &716241207 GameObject: m_ObjectHideFlags: 0 @@ -2238,7 +2052,7 @@ Transform: m_Children: - {fileID: 1476341267} m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!195 &871823190 NavMeshAgent: @@ -3179,37 +2993,6 @@ PrefabInstance: insertIndex: -1 addedObject: {fileID: 1476341268} m_SourcePrefab: {fileID: 100100000, guid: 32790d47acc86814982f18993097a759, type: 3} ---- !u!1 &898537618 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 898537619} - m_Layer: 0 - m_Name: PathElement - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &898537619 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 898537618} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.24, y: 2.51, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &927596946 GameObject: m_ObjectHideFlags: 0 @@ -3663,7 +3446,6 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 307039700} - - {fileID: 2047049769} - {fileID: 1550470211} - {fileID: 1689632238} m_Father: {fileID: 0} @@ -4084,37 +3866,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1098221748} m_Mesh: {fileID: 4708089918399356098, guid: 0d817475ce7adaa4f81fbdb111b8599c, type: 3} ---- !u!1 &1152324440 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1152324441} - m_Layer: 0 - m_Name: PathElement (4) - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1152324441 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1152324440} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -4.87, y: 1.26, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1170073355 GameObject: m_ObjectHideFlags: 0 @@ -4221,37 +3972,6 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1170073355} m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!1 &1182335880 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1182335881} - m_Layer: 0 - m_Name: PathElement (1) - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1182335881 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1182335880} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -1.7562476, y: 2.476255, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1183172156 GameObject: m_ObjectHideFlags: 0 @@ -4283,7 +4003,7 @@ Transform: m_Children: - {fileID: 1359374191} m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1183172158 MonoBehaviour: @@ -9523,37 +9243,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 200, y: 30} m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &1382752552 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1382752553} - m_Layer: 0 - m_Name: PathElement (5) - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1382752553 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1382752552} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -6.17, y: 0.18, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 5 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1402372336 stripped Transform: m_CorrespondingSourceObject: {fileID: 168138393772344589, guid: 7da3da938889a5a44808355c805dcccb, @@ -9779,7 +9468,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 705507995} - {fileID: 1856998490} m_Father: {fileID: 0} m_RootOrder: 2 @@ -9879,7 +9567,7 @@ RectTransform: m_Children: - {fileID: 223732183} m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -10222,37 +9910,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1750970806} m_CullTransparentMesh: 1 ---- !u!1 &1791787532 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1791787533} - m_Layer: 0 - m_Name: PathElement (3) - m_TagString: Untagged - m_Icon: {fileID: -5487077368411116049, guid: 0000000000000000d000000000000000, type: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1791787533 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1791787532} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -5.396248, y: 1.9662551, z: 0.9502182} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 101167831} - m_RootOrder: 3 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1811096133 GameObject: m_ObjectHideFlags: 0 @@ -10685,128 +10342,6 @@ Transform: m_Father: {fileID: 656725490} m_RootOrder: -1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &2047049764 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 2047049769} - - component: {fileID: 2047049768} - - component: {fileID: 2047049767} - - component: {fileID: 2047049766} - - component: {fileID: 2047049765} - m_Layer: 0 - m_Name: followpath - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!114 &2047049765 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2047049764} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a17411f0f5c4b764fb4afd65c74cbcb5, type: 3} - m_Name: - m_EditorClassIdentifier: - MovementType: 0 - MyPath: {fileID: 101167830} - speed: 1 - maxDistance: 0.1 ---- !u!65 &2047049766 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2047049764} - 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!23 &2047049767 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2047049764} - 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_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - 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_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!33 &2047049768 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2047049764} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &2047049769 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2047049764} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0.65, y: 3.46, z: -17.134588} - m_LocalScale: {x: 0.4125, y: 0.39875, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 971260931} - m_RootOrder: 1 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2053101242 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/DialogueSystem/ConversationController.cs b/Assets/Scripts/DialogueSystem/ConversationController.cs index c50c25d0..f412cbf0 100644 --- a/Assets/Scripts/DialogueSystem/ConversationController.cs +++ b/Assets/Scripts/DialogueSystem/ConversationController.cs @@ -59,14 +59,14 @@ public class ConversationController : MonoBehaviour _selectedAction = action; if (action is ISellable) { - _btnApply.interactable = Player.Instance.Stats[StatsId.Money].Value >= (action as ISellable).Price; + // _btnApply.interactable = Player.Instance.Stats[StatsId.Money].Value >= (action as ISellable).Price; } } private void ApplyActionOnPlayer(IPlayerAction action) { - if (action is ISellable) - Player.Instance.BuyAction(action); + //if (action is ISellable) + // Player.Instance.BuyAction(action); } private void RemoveChoices() { diff --git a/Assets/Scripts/InteractableObjects/ColaFreezer.cs b/Assets/Scripts/InteractableObjects/ColaFreezer.cs index ad138f09..0ddc63b0 100644 --- a/Assets/Scripts/InteractableObjects/ColaFreezer.cs +++ b/Assets/Scripts/InteractableObjects/ColaFreezer.cs @@ -10,6 +10,7 @@ public class ColaFreezer : BaseInteractableObject { if (!player.HasFoodObject()) { + player.BuyObject(_foodObjectSO); // Spawn new object and set to player var transform = Instantiate(_foodObjectSO.prefab, _playerArrivePoint); var foodObject = transform.GetComponent(); diff --git a/Assets/Scripts/InteractableObjects/Fridge.cs b/Assets/Scripts/InteractableObjects/Fridge.cs index 38b8e26a..b63512b2 100644 --- a/Assets/Scripts/InteractableObjects/Fridge.cs +++ b/Assets/Scripts/InteractableObjects/Fridge.cs @@ -4,7 +4,7 @@ using UnityEngine; public class Fridge : BaseInteractableObject { - private const int _maxCapacity=4; + private const int _maxCapacity=10; private List _foodObjects= new List(); public override void Interact(Player player) @@ -20,6 +20,18 @@ public class Fridge : BaseInteractableObject else Debug.Log($"Fridge is full"); } + else + { + //Eat menu + if (_foodObjects.Count>0) + { + while(player.Stats[StatsId.Food].Value< player.Stats[StatsId.Food].MaxValue && _foodObjects.Count > 0) + { + _foodObjects.RemoveAt(0); + player.Eat(); + } + } + } } diff --git a/Assets/Scripts/Player/Player.cs b/Assets/Scripts/Player/Player.cs index 8f0479ac..0c1ad9ec 100644 --- a/Assets/Scripts/Player/Player.cs +++ b/Assets/Scripts/Player/Player.cs @@ -203,22 +203,28 @@ public class Player : MonoBehaviour public void UpdateStatsByClock() { - Stats[StatsId.Food].deduct(0.034m); // 48 hours it's 100, 100/2880=~0.034 per minute + Stats[StatsId.Food].deduct(0.034f); // 48 hours it's 100, 100/2880=~0.034 per minute if (_currentAnimation != AnimationStates.Sleeping) { - Stats[StatsId.Energy].deduct(0.1m); // 24 hours it's 100, 100/1440=~0.096 per minute + Stats[StatsId.Energy].deduct(0.1f); // 24 hours it's 100, 100/1440=~0.096 per minute } else { - Stats[StatsId.Energy].increase(1m); + Stats[StatsId.Energy].increase(1f); } } - public void BuyAction(IPlayerAction action) + public void BuyObject(FoodObjectSO objectToBuy) { - Stats[StatsId.Money].deduct(((ISellable)action).Price); - action.ApplyAction(this); + Stats[StatsId.Money].deduct(objectToBuy.objectPrice); + //action.ApplyAction(this); + } + + public float Eat() + { + Stats[StatsId.Food].increase(10); + return Stats[StatsId.Food].Value; } private static string GetEnumMemberValue(T value) diff --git a/Assets/Scripts/Player/PlayerStats.cs b/Assets/Scripts/Player/PlayerStats.cs index 17a0f115..8fa188ea 100644 --- a/Assets/Scripts/Player/PlayerStats.cs +++ b/Assets/Scripts/Player/PlayerStats.cs @@ -7,12 +7,12 @@ public class PlayerStats { return new Dictionary() { - {StatsId.Money, new Stat("Money", 100.0m)}, - {StatsId.RentAccount, new Stat("Rent Account", 0)}, - {StatsId.Food, new Stat("Food Energy", 50) }, - {StatsId.Energy,new Stat("Energy", 100) }, - {StatsId.BankAccount,new Stat("Bank Account", 0) }, - {StatsId.Job, new Stat("Unemployed", 0) }, + {StatsId.Money, new Stat("Money", 100.0f,10000000f)}, + {StatsId.RentAccount, new Stat("Rent Account", 0,10f)}, + {StatsId.Food, new Stat("Food Energy", 50,100f) }, + {StatsId.Energy,new Stat("Energy", 100,100f) }, + //{StatsId.BankAccount,new Stat("Bank Account", 0) }, + {StatsId.Job, new Stat("Unemployed", 0, 100f) }, }; } //// Knowledge for University Jobs diff --git a/Assets/Scripts/Player/Stat.cs b/Assets/Scripts/Player/Stat.cs index ba84f231..a6d62b7c 100644 --- a/Assets/Scripts/Player/Stat.cs +++ b/Assets/Scripts/Player/Stat.cs @@ -1,29 +1,32 @@ public class Stat { public string Name { get; set; } - public decimal Value { get; set; } - public decimal Price { get; set; } - public decimal Quantity { get; set; } + public float Value { get; set; } + public float Price { get; set; } + public float Quantity { get; set; } + public float MaxValue { get; set; } - public Stat(string name, decimal startValue) + public Stat(string name, float startValue, float maxValue) { Name = name; Value = startValue; + MaxValue = maxValue; } - public Stat(string name, decimal price, decimal quantity) + public Stat(string name, float price, float quantity, float maxValue) { Name = name; Price = price; Quantity = quantity; + MaxValue = maxValue; } - public void increase(decimal byAmount) + public void increase(float byAmount) { Value += byAmount; } - public bool deduct(decimal amount) + public bool deduct(float amount) { if (Value >= amount) { @@ -33,7 +36,7 @@ public class Stat return false; } - public void forceDeduct(decimal amount) + public void forceDeduct(float amount) { Value -= amount; } diff --git a/Assets/Scripts/ScriptableObjects/Cola.asset b/Assets/Scripts/ScriptableObjects/Cola.asset index e7a79bd9..7071de45 100644 --- a/Assets/Scripts/ScriptableObjects/Cola.asset +++ b/Assets/Scripts/ScriptableObjects/Cola.asset @@ -14,4 +14,4 @@ MonoBehaviour: m_EditorClassIdentifier: prefab: {fileID: 2680879424619819010, guid: 48940f42625c11541b2ebe92e86b6314, type: 3} objectName: Cola - objectPrice: 0 + objectPrice: 10 diff --git a/Assets/Scripts/TimeManager.cs b/Assets/Scripts/TimeManager.cs index 82d69c73..bbc81c36 100644 --- a/Assets/Scripts/TimeManager.cs +++ b/Assets/Scripts/TimeManager.cs @@ -8,8 +8,8 @@ public class TimeManager : MonoBehaviour [SerializeField] private float _startHour; - [SerializeField] - private Light _sunLight; + //[SerializeField] + //private Light _sunLight; [SerializeField] private float _sunriseHour; @@ -31,7 +31,7 @@ public class TimeManager : MonoBehaviour // Start is called before the first frame update void Start() { - _sunInitialIntensity = _sunLight.intensity; + // _sunInitialIntensity = _sunLight.intensity; _timer = _minuteToRealTime; _currentTime = TimeSpan.Zero + TimeSpan.FromHours(_startHour); _sunriseTime = TimeSpan.FromHours(_sunriseHour); @@ -61,7 +61,7 @@ public class TimeManager : MonoBehaviour { float intensityMultiplier = 1; float timeofDay = (float)(CurrentTime.TotalDays - CurrentTime.Days); - _sunLight.transform.localRotation = Quaternion.Euler((timeofDay * 360f) - 90, 170, 0); + //_sunLight.transform.localRotation = Quaternion.Euler((timeofDay * 360f) - 90, 170, 0); if (timeofDay > _sunriseTime.TotalDays && timeofDay < _sunsetTime.TotalDays) { if (timeofDay <= _sunsetTime.TotalDays) @@ -73,7 +73,7 @@ public class TimeManager : MonoBehaviour { intensityMultiplier = 0; } - _sunLight.intensity = _sunInitialIntensity * intensityMultiplier; + // _sunLight.intensity = _sunInitialIntensity * intensityMultiplier; } private TimeSpan CalculateTimeDifference(TimeSpan from, TimeSpan to)