From 18b70e8b6788bab7fea05331930f3e50a1356eee Mon Sep 17 00:00:00 2001 From: Matheus Cirillo Date: Sat, 11 Mar 2023 11:56:07 -0300 Subject: [PATCH] Fixed bugs Fix Indicators not updating on start fix water button fix food view fix energy fix time passing after eating --- unity-project/Assets/Resources/FoodDB-Old.csv | 46 ++++++++++ ...FoodDBtab.csv.meta => FoodDB-Old.csv.meta} | 2 +- unity-project/Assets/Resources/FoodDB.csv | 92 +++++++++---------- .../Assets/Scenes/CharacterSelection.unity | 30 +++++- unity-project/Assets/Scenes/GameScene.unity | 46 +++++----- .../Assets/Scripts/Body/UI/BloodGlucose.cs | 4 +- unity-project/Assets/Scripts/Body/UI/Heart.cs | 1 + .../Assets/Scripts/Body/UI/Weight.cs | 5 +- .../Scripts/Foods/FoodTypeScriptableObject.cs | 6 +- unity-project/Assets/Scripts/Foods/Fridge.cs | 13 +-- unity-project/Assets/Scripts/Foods/Plate.cs | 29 ++++-- .../Assets/Scripts/Foods/UI/Fridge.cs | 2 +- .../Assets/Scripts/Foods/UI/Plate.cs | 16 +++- .../Assets/Scripts/SaveSystem/SaveState.cs | 2 +- unity-project/Assets/Scripts/Timer/Clock.cs | 2 +- 15 files changed, 200 insertions(+), 96 deletions(-) create mode 100644 unity-project/Assets/Resources/FoodDB-Old.csv rename unity-project/Assets/Resources/{FoodDBtab.csv.meta => FoodDB-Old.csv.meta} (75%) diff --git a/unity-project/Assets/Resources/FoodDB-Old.csv b/unity-project/Assets/Resources/FoodDB-Old.csv new file mode 100644 index 0000000..cd79725 --- /dev/null +++ b/unity-project/Assets/Resources/FoodDB-Old.csv @@ -0,0 +1,46 @@ +;Peso;Medida;Calorias;Carbs;Gordura;Proteina;Consumo;Fibras;Umidade +Pizza;250;g;300;35;12;13;0;8;55.39 +Hamburguer;400;g;267;11.04;16.01;19.3;0;0;52.37 +Coxinha;80;g;283.048;34.52058333;11.836;9.610416667;0;4.970333333;42.21066667 +Pastel;400;g;422.11208;48.13273362;22.67033333;8.709599709;0;0.943333333;17.541 +Pão de queijo;100;g;363.0779133;34.2415;24.56733333;5.120833333;0;0.558333333;33.736 +Batata-frita;100;g;542.7346734;51.22233333;36.615;5.583333333;0;2.455666667;2.697333333 +Pipoca;100;g;448.3342618;70.31258333;15.941;9.927083333;0;14.33666667;2.819 +Milk-shake;230;ml;118;15.57;5.18;2.68;0;0.7;73.368 +Sorvete;60;g;255;20.57;16.98;4.72;0;0.9;57.52 +Bolo;100;g;410.0136667;54.71775;18.47233333;6.222916667;0;1.43;19.27633333 +Doce de leite;20;g;306.3101302;59.49337324;5.993;5.478293432;0;0;27.5 +Chocolate;100;g;539.5866667;59.57666667;30.26666667;7.22;0;2.17;1.256666667 +Ovo cozido;40;g;145.70017;0.614916667;9.476333333;13.29375;0;0;75.76566667 +Ovo frito;50;g;240.187224;1.193666667;18.59266667;15.61666667;0;0;63.49733333 +Misto quente;100;g;241;22.84;10.6;14.17;0;0;74.17 +Tapioca;100;g;347.8265563;63.59175;10.90833333;0.089583333;0;0;24.90233333 +Queijo;122;g;264.273128;3.240313333;20.18066667;17.41102;0;0;56.12466667 +Maça;120;g;62.53181837;16.588;0.246;0.225;0;2.026333333;82.649 +Banana;118;g;91.52884783;23.84811594;0.116666667;1.398550725;0;1.946666667;73.79666667 +Mamão;150;g;40.15676894;10.43975;0.124333333;0.45625;0;1.042666667;88.583 +Abacate;100;g;96.1547087;6.030869565;8.396666667;1.239130435;0;6.313333333;83.78666667 +Laranja;90;g;45.70103878;11.53375;0.075333333;1.05625;0;1.782;86.974 +Morango;50;g;30.14791739;6.818405797;0.31;0.894927536;0;1.723333333;91.52666667 +Leite;200;ml;69.621474;15.67447333;0.099;1.89486;0;0;81.87933333 +Café;60;ml;418.6186667;65.75333333;11.94666667;14.7;0;51.22666667;2.93 +Suco de laranja;200;ml;39.33609394;9.167416667;0.119333333;0.714583333;0;0.424;89.68066667 +Refrigerante;200;ml;33.5142;8.66;0;0;0;0;91.27666667 +Arroz;100;g;128.2584857;28.05985;0.227;2.520816667;0;1.561;69.11366667 +Batata assada;100;g;51.58847664;11.94375;0;1.164583333;0;1.343333333;86.35966667 +Feijão;100;g;76.42408567;13.59103333;0.542333333;4.775;0;8.510333333;80.35063333 +Frango;100;g;159.1850072;0;2.483666667;32.03333333;0;0;63.80933333 +Bife;100;g;193.6915667;0;4.486666667;35.88333333;0;0;57.53333333 +Lasanha;300;g;163.7636667;32.52216667;1.158333333;5.8125;0;1.636333333;59.64633333 +Peixe;113;g;131.2083147;0;5.641666667;18.81041667;0;0;76.16 +Nhoque;200;g;180.775274;36.78;1.943333333;5.858333333;0;1.78;54.954 +Macarrão;80;g;119.5317714;22.52236683;0.889666667;4.934299835;0;0.776666667;71.41233333 +Alface;25;g;8.794903237;1.745333333;0.129;0.608333333;0;1.021666667;97.16866667 +Tomate;50;g;15.33515652;3.13884058;0.173333333;1.097826087;0;1.173333333;95.12666667 +Repolho;70;g;17.1188029;3.859855072;0.143333333;0.876811594;0;1.89;94.72 +Cenoura;100;g;29.86177771;6.68675;0.218333333;0.847916667;0;2.629;91.663 +Couve-flor;100;g;19.11414061;3.875416667;0.269333333;1.239583333;0;2.130333333;94.33833333 +Brocolis;100;g;24.63616311;4.366666667;0.459;2.133333333;0;3.416666667;92.617 +Nozes;100;g;620.0600198;18.36386616;59.35966667;13.9708005;0;7.249666667;6.244666667 +Atum;110;g;165.9105606;0;5.996666667;26.1875;0;0;64.5 +Sardinha;100;g;284.9810049;0;24.04866667;15.93958333;0;0;55.14266667 diff --git a/unity-project/Assets/Resources/FoodDBtab.csv.meta b/unity-project/Assets/Resources/FoodDB-Old.csv.meta similarity index 75% rename from unity-project/Assets/Resources/FoodDBtab.csv.meta rename to unity-project/Assets/Resources/FoodDB-Old.csv.meta index c610886..21d1b3f 100644 --- a/unity-project/Assets/Resources/FoodDBtab.csv.meta +++ b/unity-project/Assets/Resources/FoodDB-Old.csv.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: af250546edbc1c147a255b24c4201281 +guid: ce7fc63d1a9a9ba4ba0cb2292283a1b5 TextScriptImporter: externalObjects: {} userData: diff --git a/unity-project/Assets/Resources/FoodDB.csv b/unity-project/Assets/Resources/FoodDB.csv index b4cfd4c..6a62310 100644 --- a/unity-project/Assets/Resources/FoodDB.csv +++ b/unity-project/Assets/Resources/FoodDB.csv @@ -1,46 +1,46 @@ -;Peso;Medida;Calorias;Carbs;Gordura;Proteina;Consumo;Fibras;Umidade -Pizza;250;g;300;35;12;13;0;8;55.39 -Hamburguer;400;g;267;11.04;16.01;19.3;0;0;52.37 -Coxinha;80;g;283.048;34.52058333;11.836;9.610416667;0;4.970333333;42.21066667 -Pastel;400;g;422.11208;48.13273362;22.67033333;8.709599709;0;0.943333333;17.541 -Pão de queijo;100;g;363.0779133;34.2415;24.56733333;5.120833333;0;0.558333333;33.736 -Batata-frita;100;g;542.7346734;51.22233333;36.615;5.583333333;0;2.455666667;2.697333333 -Pipoca;100;g;448.3342618;70.31258333;15.941;9.927083333;0;14.33666667;2.819 -Milk-shake;230;ml;118;15.57;5.18;2.68;0;0.7;73.368 -Sorvete;60;g;255;20.57;16.98;4.72;0;0.9;57.52 -Bolo;100;g;410.0136667;54.71775;18.47233333;6.222916667;0;1.43;19.27633333 -Doce de leite;20;g;306.3101302;59.49337324;5.993;5.478293432;0;0;27.5 -Chocolate;11;g;539.5866667;59.57666667;30.26666667;7.22;0;2.17;1.256666667 -Ovo cozido;40;g;145.70017;0.614916667;9.476333333;13.29375;0;0;75.76566667 -Ovo frito;50;g;240.187224;1.193666667;18.59266667;15.61666667;0;0;63.49733333 -Misto quente;100;g;241;22.84;10.6;14.17;0;0;74.17 -Tapioca;100;g;347.8265563;63.59175;10.90833333;0.089583333;0;0;24.90233333 -Queijo;122;g;264.273128;3.240313333;20.18066667;17.41102;0;0;56.12466667 -Maça;120;g;62.53181837;16.588;0.246;0.225;0;2.026333333;82.649 -Banana;118;g;91.52884783;23.84811594;0.116666667;1.398550725;0;1.946666667;73.79666667 -Mamão;150;g;40.15676894;10.43975;0.124333333;0.45625;0;1.042666667;88.583 -Abacate;100;g;96.1547087;6.030869565;8.396666667;1.239130435;0;6.313333333;83.78666667 -Laranja;90;g;45.70103878;11.53375;0.075333333;1.05625;0;1.782;86.974 -Morango;50;g;30.14791739;6.818405797;0.31;0.894927536;0;1.723333333;91.52666667 -Leite;200;ml;69.621474;15.67447333;0.099;1.89486;0;0;81.87933333 -Café;60;ml;418.6186667;65.75333333;11.94666667;14.7;0;51.22666667;2.93 -Suco de laranja;200;ml;39.33609394;9.167416667;0.119333333;0.714583333;0;0.424;89.68066667 -Refrigerante;200;ml;33.5142;8.66;0;0;0;0;91.27666667 -Arroz;100;g;128.2584857;28.05985;0.227;2.520816667;0;1.561;69.11366667 -Batata assada;100;g;51.58847664;11.94375;0;1.164583333;0;1.343333333;86.35966667 -Feijão;100;g;76.42408567;13.59103333;0.542333333;4.775;0;8.510333333;80.35063333 -Frango;100;g;159.1850072;0;2.483666667;32.03333333;0;0;63.80933333 -Bife;100;g;193.6915667;0;4.486666667;35.88333333;0;0;57.53333333 -Lasanha;300;g;163.7636667;32.52216667;1.158333333;5.8125;0;1.636333333;59.64633333 -Peixe;113;g;131.2083147;0;5.641666667;18.81041667;0;0;76.16 -Nhoque;200;g;180.775274;36.78;1.943333333;5.858333333;0;1.78;54.954 -Macarrão;80;g;119.5317714;22.52236683;0.889666667;4.934299835;0;0.776666667;71.41233333 -Alface;25;g;8.794903237;1.745333333;0.129;0.608333333;0;1.021666667;97.16866667 -Tomate;50;g;15.33515652;3.13884058;0.173333333;1.097826087;0;1.173333333;95.12666667 -Repolho;70;g;17.1188029;3.859855072;0.143333333;0.876811594;0;1.89;94.72 -Cenoura;100;g;29.86177771;6.68675;0.218333333;0.847916667;0;2.629;91.663 -Couve-flor;100;g;19.11414061;3.875416667;0.269333333;1.239583333;0;2.130333333;94.33833333 -Brocolis;100;g;24.63616311;4.366666667;0.459;2.133333333;0;3.416666667;92.617 -Nozes;100;g;620.0600198;18.36386616;59.35966667;13.9708005;0;7.249666667;6.244666667 -Atum;110;g;165.9105606;0;5.996666667;26.1875;0;0;64.5 -Sardinha;100;g;284.9810049;0;24.04866667;15.93958333;0;0;55.14266667 +Column1;Peso;Medida;Calorias;Carbs;Gordura;Proteina;Consumo;Fibras;Umidade +Pizza;250.0;g;300.0;35.0;12.0;13.0;0.6;8.0;55.4 +Hamburguer;400.0;g;267.0;11.0;16.0;19.3;1.1;0.0;52.4 +Coxinha;80.0;g;283.0;34.5;11.8;9.6;1.4;5.0;42.2 +Pastel;400.0;g;422.1;48.1;22.7;8.7;1.7;0.9;17.5 +Pão de queijo;100.0;g;363.1;34.2;24.6;5.1;0.1;0.6;33.7 +Batata-frita;100.0;g;542.7;51.2;36.6;5.6;0.8;2.5;2.7 +Pipoca;100.0;g;448.3;70.3;15.9;9.9;0.4;14.3;2.8 +Milk-shake;230.0;ml;118.0;15.6;5.2;2.7;0.7;0.7;73.4 +Sorvete;60.0;g;255.0;20.6;17.0;4.7;2.0;0.9;57.5 +Bolo;100.0;g;410.0;54.7;18.5;6.2;2.0;1.4;19.3 +Doce de leite;20.0;g;306.3;59.5;6.0;5.5;2.6;0.0;27.5 +Chocolate;100.0;g;539.6;59.6;30.3;7.2;2.3;2.2;1.3 +Ovo cozido;40.0;g;145.7;0.6;9.5;13.3;1.2;0.0;75.8 +Ovo frito;50.0;g;240.2;1.2;18.6;15.6;0.2;0.0;63.5 +Misto quente;100.0;g;241.0;22.8;10.6;14.2;0.7;0.0;74.2 +Tapioca;100.0;g;347.8;63.6;10.9;0.1;1.5;0.0;24.9 +Queijo;122.0;g;264.3;3.2;20.2;17.4;1.1;0.0;56.1 +Maçã;120.0;g;62.5;16.6;0.2;0.2;0.2;2.0;82.6 +Banana;118.0;g;91.5;23.8;0.1;1.4;0.0;1.9;73.8 +Mamão;150.0;g;40.2;10.4;0.1;0.5;0.3;1.0;88.6 +Abacate;100.0;g;96.2;6.0;8.4;1.2;0.3;6.3;83.8 +Laranja;90.0;g;45.7;11.5;0.1;1.1;0.4;1.8;87.0 +Morango;50.0;g;30.1;6.8;0.3;0.9;0.2;1.7;91.5 +Leite;200.0;ml;69.6;15.7;0.1;1.9;0.5;0.0;81.9 +Café;60.0;ml;418.6;65.8;11.9;14.7;1.1;51.2;2.9 +Suco de laranja;200.0;ml;39.3;9.2;0.1;0.7;0.3;0.4;89.7 +Refrigerante;200.0;ml;33.5;8.7;0.0;0.0;0.2;0.0;91.3 +Arroz;100.0;g;128.3;28.1;0.2;2.5;0.6;1.6;69.1 +Batata assada;100.0;g;51.6;11.9;0.0;1.2;0.4;1.3;86.4 +Feijão;100.0;g;76.4;13.6;0.5;4.8;0.6;8.5;80.4 +Frango;100.0;g;159.2;0.0;2.5;32.0;1.5;0.0;63.8 +Bife;100.0;g;193.7;0.0;4.5;35.9;1.3;0.0;57.5 +Lasanha;300.0;g;163.8;32.5;1.2;5.8;1.1;1.6;59.6 +Peixe;113.0;g;131.2;0.0;5.6;18.8;1.3;0.0;76.2 +Nhoque;200.0;g;180.8;36.8;1.9;5.9;0.6;1.8;55.0 +Macarrão;80.0;g;119.5;22.5;0.9;4.9;0.1;0.8;71.4 +Alface;25.0;g;8.8;1.7;0.1;0.6;0.0;1.0;97.2 +Tomate;50.0;g;15.3;3.1;0.2;1.1;0.1;1.2;95.1 +Repolho;70.0;g;17.1;3.9;0.1;0.9;0.0;1.9;94.7 +Cenoura;100.0;g;29.9;6.7;0.2;0.8;0.0;2.6;91.7 +Couve-flor;100.0;g;19.1;3.9;0.3;1.2;0.0;2.1;94.3 +Brocolis;100.0;g;24.6;4.4;0.5;2.1;0.0;3.4;92.6 +Nozes;100.0;g;620.1;18.4;59.4;14.0;4.3;7.2;6.2 +Atum;110.0;g;165.9;0.0;6.0;26.2;1.4;0.0;64.5 +Sardinha;100.0;g;285.0;0.0;24.0;15.9;2.5;0.0;55.1 diff --git a/unity-project/Assets/Scenes/CharacterSelection.unity b/unity-project/Assets/Scenes/CharacterSelection.unity index cf5edc2..947fea8 100644 --- a/unity-project/Assets/Scenes/CharacterSelection.unity +++ b/unity-project/Assets/Scenes/CharacterSelection.unity @@ -908,8 +908,8 @@ MonoBehaviour: m_EditorClassIdentifier: activityText: {fileID: 1673338836} weightText: {fileID: 1540711096} - sleepText: {fileID: 1180892471} - heightText: {fileID: 25131603} + sleepText: {fileID: 781735418} + heightText: {fileID: 1180892471} age: {fileID: 1172363413} manPB: {fileID: 764844255} manColor: {fileID: 486396718} @@ -933,7 +933,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &307218010 RectTransform: m_ObjectHideFlags: 0 @@ -1310,6 +1310,18 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 307218009} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 --- !u!114 &363501822 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4305,6 +4317,18 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 307218009} + m_TargetAssemblyTypeName: UnityEngine.GameObject, UnityEngine + m_MethodName: SetActive + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 --- !u!114 &1688441739 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/unity-project/Assets/Scenes/GameScene.unity b/unity-project/Assets/Scenes/GameScene.unity index a3bf221..12f84bd 100644 --- a/unity-project/Assets/Scenes/GameScene.unity +++ b/unity-project/Assets/Scenes/GameScene.unity @@ -2056,7 +2056,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 375, y: 56} + m_SizeDelta: {x: 0, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &228638086 MonoBehaviour: @@ -2456,9 +2456,9 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: - - m_Target: {fileID: 0} - m_TargetAssemblyTypeName: Water, Assembly-CSharp - m_MethodName: Hydrate + - m_Target: {fileID: 881363949} + m_TargetAssemblyTypeName: Body.Water, Assembly-CSharp + m_MethodName: ChangeWater m_Mode: 4 m_Arguments: m_ObjectArgument: {fileID: 0} @@ -3315,8 +3315,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 187.5, y: 150} - m_SizeDelta: {x: 375, y: 300} + m_AnchoredPosition: {x: 225, y: 150} + m_SizeDelta: {x: 450, y: 300} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &381225964 MonoBehaviour: @@ -3331,15 +3331,15 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Padding: - m_Left: 15 + m_Left: 5 m_Right: -5 m_Top: 10 m_Bottom: 10 - m_ChildAlignment: 4 + m_ChildAlignment: 3 m_Spacing: 2 m_ChildForceExpandWidth: 1 m_ChildForceExpandHeight: 1 - m_ChildControlWidth: 0 + m_ChildControlWidth: 1 m_ChildControlHeight: 0 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 @@ -7063,7 +7063,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 375, y: 56} + m_SizeDelta: {x: 0, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &796537712 MonoBehaviour: @@ -9273,7 +9273,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 375, y: 56} + m_SizeDelta: {x: 0, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1085737332 MonoBehaviour: @@ -11431,7 +11431,7 @@ MonoBehaviour: de energia e at\xE9 sua hidrata\xE7\xE3o." interactable: {fileID: 54065774} timeSet: - _dateTime: 01/01/2022 08:00:00 + _dateTime: 1/1/2022 8:00:00 AM - sentence: "Abra a geladeira, monte seu prato e tome um caf\xE9 da manh\xE3 refor\xE7ado para aguentar o dia.\nLembre-se que sua escolha de alimentos \xE9 extremamente importante, quando sua glicose est\xE1 alta \xE9 importante escolher alimentos @@ -11439,23 +11439,23 @@ MonoBehaviour: por comer alimentos com menos carboidratos." interactable: {fileID: 640890981} timeSet: - _dateTime: 01/01/2022 09:00:00 + _dateTime: 1/1/2022 9:00:00 AM - sentence: Estude no seu computador para melhorar suas notas e passar seu o tempo. interactable: {fileID: 569652362} timeSet: - _dateTime: 01/01/2022 11:00:00 + _dateTime: 1/1/2022 11:00:00 AM - sentence: "Outro fator importante para sua sa\xFAde \xE9 se manter hidratado. Beba \xE1gua regularmente." interactable: {fileID: 234737592} timeSet: - _dateTime: 01/01/2022 11:00:00 + _dateTime: 1/1/2022 11:00:00 AM - sentence: "Abra a geladeira e escolha seu almo\xE7o.\nExplore suas op\xE7\xF5es de alimentos e busque montar uma refei\xE7\xE3o que balanceia bem sua quantidade de macronutrientes (carboidratos, prote\xEDnas e gorduras). Lembrando sempre que saladas s\xE3o extremamente importantes na dieta de uma pessoa." interactable: {fileID: 640890981} timeSet: - _dateTime: 01/01/2022 12:30:00 + _dateTime: 1/1/2022 12:30:00 PM - sentence: "V\xE1 para a escola assim que o rel\xF3gio der 13:00.\nUsando os controles de tempo no canto superior direito voc\xEA pode alterar a velocidade de passagem do tempo, al\xE9m de parar o fluxo temporal totalmente.\nVoc\xEA \xE9 for\xE7ado @@ -11463,14 +11463,14 @@ MonoBehaviour: a\xE7\xE3o que for ser finalizada depois das 13:00 n\xE3o poder\xE1 ocorrer." interactable: {fileID: 704482757} timeSet: - _dateTime: 01/01/2022 18:00:00 + _dateTime: 1/1/2022 6:00:00 PM - sentence: "Voltando da escola \xE9 um bom hor\xE1rio para se jantar. Abra a geladeira, monte seu prato e coma.\nE se lembre o qu\xE3o importante \xE9 n\xE3o exceder um limite calorico di\xE1rio, consumir mais calorias do que seu corpo gasta leva a ganho de gordura." interactable: {fileID: 640890981} timeSet: - _dateTime: 01/01/2022 19:00:00 + _dateTime: 1/1/2022 7:00:00 PM - sentence: "Esse \xE9 um hor\xE1rio excelente para se exercitar na academia e aliviar um pouco do estresse do dia.\nO exerc\xEDcio \xE9 um fator essencial para manter sua sa\xFAde em dia, algu\xE9m que se exercita tem mais energia, @@ -11478,12 +11478,12 @@ MonoBehaviour: controle sobre sua glicose." interactable: {fileID: 2007173972} timeSet: - _dateTime: 01/01/2022 21:30:00 + _dateTime: 1/1/2022 9:30:00 PM - sentence: "Ap\xF3s um dia t\xE3o longo \xE9 sempre bom dormir e recuperar as energias para um pr\xF3ximo dia." interactable: {fileID: 54065774} timeSet: - _dateTime: 02/01/2022 07:00:00 + _dateTime: 2/1/2022 7:00:00 AM --- !u!1 &1439176073 GameObject: m_ObjectHideFlags: 0 @@ -14439,7 +14439,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 375, y: 56} + m_SizeDelta: {x: 0, y: 56} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2047156592 MonoBehaviour: @@ -14461,7 +14461,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: 'A1c: 6,1%' + m_text: 'Glicemia: 147.6mg/dL' m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 910536ca3a4774d4c94d3a11cbd474fb, type: 2} m_sharedMaterial: {fileID: 4555076882382298910, guid: 910536ca3a4774d4c94d3a11cbd474fb, type: 2} @@ -14524,7 +14524,7 @@ MonoBehaviour: m_VertexBufferAutoSizeReduction: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} + m_margin: {x: -0.6035919, y: 0, z: 0.000000014661498, w: 0} m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 m_hasFontAssetChanged: 0 diff --git a/unity-project/Assets/Scripts/Body/UI/BloodGlucose.cs b/unity-project/Assets/Scripts/Body/UI/BloodGlucose.cs index 4ab8c7a..553cb41 100644 --- a/unity-project/Assets/Scripts/Body/UI/BloodGlucose.cs +++ b/unity-project/Assets/Scripts/Body/UI/BloodGlucose.cs @@ -9,10 +9,12 @@ public class BloodGlucose : MonoBehaviour { private void Start() { state = SaveManager.Instance.state; + UpdateUI(); } public void UpdateUI(){ - bgpText.text = "Glicemia: " + state.bgp + "mg/dL"; + Debug.Log(state.bgp); + bgpText.text = "Glicemia: " + state.bgp.ToString("F1") + "mg/dL"; } } diff --git a/unity-project/Assets/Scripts/Body/UI/Heart.cs b/unity-project/Assets/Scripts/Body/UI/Heart.cs index e182013..f186b5f 100644 --- a/unity-project/Assets/Scripts/Body/UI/Heart.cs +++ b/unity-project/Assets/Scripts/Body/UI/Heart.cs @@ -9,6 +9,7 @@ public class Heart : MonoBehaviour { private void Start() { state = SaveManager.Instance.state; + UpdateUI(); } public void UpdateUI(){ diff --git a/unity-project/Assets/Scripts/Body/UI/Weight.cs b/unity-project/Assets/Scripts/Body/UI/Weight.cs index 5b2371e..65c5f69 100644 --- a/unity-project/Assets/Scripts/Body/UI/Weight.cs +++ b/unity-project/Assets/Scripts/Body/UI/Weight.cs @@ -8,11 +8,12 @@ public class Weight : MonoBehaviour{ private void Start() { state = SaveManager.Instance.state; + UpdateUI(); } public void UpdateUI(){ - weightText.text = "Peso: " + state.currentWeightKg.ToString("0.00") + "kg"; - bmiText.text = "IMC: " + state.bmi.ToString("0.00"); + weightText.text = "Peso: " + state.currentWeightKg.ToString("F1") + "kg"; + bmiText.text = "IMC: " + state.bmi.ToString("F2"); } } } \ No newline at end of file diff --git a/unity-project/Assets/Scripts/Foods/FoodTypeScriptableObject.cs b/unity-project/Assets/Scripts/Foods/FoodTypeScriptableObject.cs index 1f8b2a1..a7f3679 100644 --- a/unity-project/Assets/Scripts/Foods/FoodTypeScriptableObject.cs +++ b/unity-project/Assets/Scripts/Foods/FoodTypeScriptableObject.cs @@ -3,10 +3,10 @@ [CreateAssetMenu(fileName = "Food", menuName = "ScriptableObjects/FoodTypeScriptableObject", order = 1)] public class FoodTypeScriptableObject : ScriptableObject{ public string food, measure; - public int weight; + public float weight; public float calorieCost, carbs, protein, fat; - public int consumingTime; - public float processingLevel; + public float consumingTime; + public float fibers, water; public GameObject go; } diff --git a/unity-project/Assets/Scripts/Foods/Fridge.cs b/unity-project/Assets/Scripts/Foods/Fridge.cs index 508faf5..8d64a1a 100644 --- a/unity-project/Assets/Scripts/Foods/Fridge.cs +++ b/unity-project/Assets/Scripts/Foods/Fridge.cs @@ -21,20 +21,21 @@ List LoadFoodDatabase(TextAsset dataset){ string[] lines = dataset.text.Split('\n'); for(int i = 1; i < lines.Length - 1; i++) { - var data = lines[i].Split(';'); + var data = lines[i].Split(';'); - FoodTypeScriptableObject _f = new FoodTypeScriptableObject(); + FoodTypeScriptableObject _f = new FoodTypeScriptableObject(); + //get raw data _f.food = data[0]; - _f.weight = int.Parse(data[1], CultureInfo.InvariantCulture); + _f.weight = float.Parse(data[1], CultureInfo.InvariantCulture); _f.measure = data[2]; float cals = float.Parse(data[3], CultureInfo.InvariantCulture); float carbs = float.Parse(data[4], CultureInfo.InvariantCulture); - Debug.Log(data[5]); float fats = float.Parse(data[5], CultureInfo.InvariantCulture); float proteins = float.Parse(data[6], CultureInfo.InvariantCulture); - _f.consumingTime = int.Parse(data[7], CultureInfo.InvariantCulture); - _f.processingLevel = float.Parse(data[8], CultureInfo.InvariantCulture); + _f.consumingTime = float.Parse(data[7], CultureInfo.InvariantCulture); + _f.fibers = float.Parse(data[8], CultureInfo.InvariantCulture); + _f.water = float.Parse(data[9], CultureInfo.InvariantCulture); //data processing _f.calorieCost = (100 * cals)/_f.weight; diff --git a/unity-project/Assets/Scripts/Foods/Plate.cs b/unity-project/Assets/Scripts/Foods/Plate.cs index 374a474..ea5e1ad 100644 --- a/unity-project/Assets/Scripts/Foods/Plate.cs +++ b/unity-project/Assets/Scripts/Foods/Plate.cs @@ -9,24 +9,36 @@ public List FoodPlate{ } public void AddToPlate(FoodTypeScriptableObject food){ - foodPlate.Add(food); + if(foodPlate.Contains(food)){ + int i = foodPlate.FindIndex(p => p.food == food.food); + foodPlate[i].weight += food.weight; + + foodPlate[i].calorieCost += food.calorieCost; + foodPlate[i].carbs += food.carbs; + foodPlate[i].fat += food.fat; + foodPlate[i].protein += food.protein; + }else{ + foodPlate.Add(food); + } } + public void RemoveFromPlate(FoodTypeScriptableObject food){ foodPlate.Remove(food); } public void EatPlate(){ - float calories = 0, carbs = 0, protein = 0, fat = 0, processingAverage = 0; + float calories = 0, carbs = 0, protein = 0, fat = 0, fibers = 0, water = 0, time = 0; foreach(FoodTypeScriptableObject item in foodPlate){ calories += item.calorieCost; carbs += item.carbs; protein += item.protein; fat += item.fat; - processingAverage += item.processingLevel; + fibers += item.fibers; + water += item.water; + time += item.consumingTime; } //Debug.Log(calories); - processingAverage /= foodPlate.Count; GetComponent().RemoveFood(); SaveManager.Instance.state.calorieDifference += calories; @@ -35,10 +47,13 @@ public void EatPlate(){ SaveManager.Instance.state.fat += fat; GetComponent().DailyNutritionalInfo(); - FindObjectOfType().ChangeEnergy(-1 * processingAverage/10f); - SaveManager.Instance.state.sleepQuality -= processingAverage/10f; + FindObjectOfType().ChangeEnergy((fibers + (water/1000))/100); + //!there should be a way in here that the type of food you each impacts your sleep + //!SaveManager.Instance.state.sleepQuality -= ; + + FindObjectOfType().AddCarbsToBloodStream(carbs); - FindObjectOfType().AddCarbsToBloodStream(4); + FindObjectOfType().AddTime(time/60f); } } } \ No newline at end of file diff --git a/unity-project/Assets/Scripts/Foods/UI/Fridge.cs b/unity-project/Assets/Scripts/Foods/UI/Fridge.cs index 7161729..c4ad521 100644 --- a/unity-project/Assets/Scripts/Foods/UI/Fridge.cs +++ b/unity-project/Assets/Scripts/Foods/UI/Fridge.cs @@ -42,7 +42,7 @@ public void DisplayFoodInOptions(FoodTypeScriptableObject food, string template, name.text = food.food; SetChartValues(macros, chart); //wholeness.fillAmount = food.processingLevel; - calorieCost.text = food.calorieCost.ToString(); + calorieCost.text = food.calorieCost.ToString("F1"); food.go = newFoodType; } diff --git a/unity-project/Assets/Scripts/Foods/UI/Plate.cs b/unity-project/Assets/Scripts/Foods/UI/Plate.cs index ddcc152..8150163 100644 --- a/unity-project/Assets/Scripts/Foods/UI/Plate.cs +++ b/unity-project/Assets/Scripts/Foods/UI/Plate.cs @@ -28,13 +28,27 @@ public void AddCurrentFoodToPlate(){ return; ChangeCurrentFoodQuantity(weightSlider.value); + + //at this point i should check if the food can be added GetComponent().AddToPlate(selectedFood); Foods.UI.Fridge generalUI = GetComponent(); - DisplayFoodInPlate(selectedFood, "foodInPlateButton", plateContainer.transform); generalUI.SetChartValues(new float[3]{0, 0, 0}, macroBarChart); foodName.text = "-"; + Transform plateTransform = plateContainer.transform; + // Loop through all the children of the plate container game object + for (int i = plateTransform.childCount - 1; i >= 0; i--){ + // Get a reference to the current child transform + Transform childTransform = plateTransform.GetChild(i); + // Destroy the child game object + GameObject.Destroy(childTransform.gameObject); + } + + foreach (FoodTypeScriptableObject item in GetComponent().FoodPlate){ + DisplayFoodInPlate(item, "foodInPlateButton", plateContainer.transform); + } + selectedFood = null; PlateNutritionalInfo(); } diff --git a/unity-project/Assets/Scripts/SaveSystem/SaveState.cs b/unity-project/Assets/Scripts/SaveSystem/SaveState.cs index 75490d4..0493e53 100644 --- a/unity-project/Assets/Scripts/SaveSystem/SaveState.cs +++ b/unity-project/Assets/Scripts/SaveSystem/SaveState.cs @@ -23,7 +23,7 @@ public class SaveState{ public float hydration = 0.5f; - public int[] date = new int[6]{2022, 1, 1, 0, 1, 0}; + public int[] date = new int[6]{2021, 12, 31, 23, 59, 0}; public int[] exerciseHistory = new int[7]{0, 0, 0, 0, 0, 0, 0}; diff --git a/unity-project/Assets/Scripts/Timer/Clock.cs b/unity-project/Assets/Scripts/Timer/Clock.cs index c7f63b8..3144aa3 100644 --- a/unity-project/Assets/Scripts/Timer/Clock.cs +++ b/unity-project/Assets/Scripts/Timer/Clock.cs @@ -6,7 +6,7 @@ namespace Timer{ public class Clock : MonoBehaviour{ public static bool timeStopped = false; - private DateTime date = new DateTime(2022, 1, 1, 0, 0, 0); + private DateTime date = new DateTime(2021, 12, 31, 23, 59, 0); public DateTime Date{ get{ return date;