From 5cf0257e181451aa6c819ed13800965adf6d62a7 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Wed, 25 Apr 2018 13:47:56 -0500 Subject: [PATCH 01/24] Added progress bars, working on integrating the actual fitbit data and goal system --- MoCha/Assets/Prefabs/ProgressBar.prefab | Bin 0 -> 5292 bytes MoCha/Assets/Prefabs/ProgressBar.prefab.meta | 10 +++ MoCha/Assets/Scripts/GetGoals.cs | 84 ++++++++++++++++++ .../{Goals.cs.meta => GetGoals.cs.meta} | 4 +- MoCha/Assets/Scripts/Goals.cs | 16 ---- MoCha/ProjectSettings/ProjectVersion.txt | 2 +- 6 files changed, 97 insertions(+), 19 deletions(-) create mode 100644 MoCha/Assets/Prefabs/ProgressBar.prefab create mode 100644 MoCha/Assets/Prefabs/ProgressBar.prefab.meta create mode 100644 MoCha/Assets/Scripts/GetGoals.cs rename MoCha/Assets/Scripts/{Goals.cs.meta => GetGoals.cs.meta} (77%) delete mode 100644 MoCha/Assets/Scripts/Goals.cs diff --git a/MoCha/Assets/Prefabs/ProgressBar.prefab b/MoCha/Assets/Prefabs/ProgressBar.prefab new file mode 100644 index 0000000000000000000000000000000000000000..f735d608f81871d1152eba96ade16bbe7630da10 GIT binary patch literal 5292 zcmeHLU2GIp6h5>4x?SAvmf2}#Nep8G z#;C*>1u-!x4-%0kMkC=T#y~=1cmTr#CK5$r^g-iaAdy6a_51GKyPetH7z|G)4jlHL zZ|?o>nRD;??hGOmKNFcWEF!mwOuU3&X{>KpT-Q`r-_sy}jf{*~<-mR@!#^VDE7fshM`9*`EXS0xSZ%7!iN5h>sy7aM2R6@aI68_#au~lg7#$TOzl^*q`Gq zpZ6nj7Cf`y-vr~VdQ6#I1Y;9?@@Os}_sXOW{0{*e1FL{xD#ddi_)7TXuO#mCUYXSZ z9vbl~;wOlgEBW@P@K0Aj}os6#d#}nWmWPRVq~23C**O>zXLw`vBo9&ClZeq z^K*Sl@lVR*IuEp)zPE2OLRv zZgIN2^-hli{w@c+>z%&zpwr!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fMh zezgKW>M{vfGJo>rITOl-?@E0z3pVfEu)BZL1eNrD_z~FA--loO>Cj$l3OalYzYNB{ zv`g6!@UL!5^tXMlOr5#r*LNYIpKU69Xzw|q=>(K)WSUr zy;9FvYChACzb5B}T!lWraeF#;*Ilt`;cGmP!h F*WZ-SCJX=o literal 0 HcmV?d00001 diff --git a/MoCha/Assets/Prefabs/ProgressBar.prefab.meta b/MoCha/Assets/Prefabs/ProgressBar.prefab.meta new file mode 100644 index 0000000..0ce5346 --- /dev/null +++ b/MoCha/Assets/Prefabs/ProgressBar.prefab.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 76a3a676c97c14505abe10fa7fa30134 +timeCreated: 1524600874 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs new file mode 100644 index 0000000..0e38cfd --- /dev/null +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -0,0 +1,84 @@ +using System; +using System.Globalization; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +//Pretty much a copy of GetData... + +public class GetGoals : MonoBehaviour { + + public Text objectText; + + public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy/mm"); + public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy/mm"); + + public string prefKey; + + void Start () { + objectText = GetComponent (); + + currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); + goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); + } + + //Progress Bar... + public float barDisplay; //current progress + public Vector2 barPos = new Vector2(20,190); + public Vector2 barSize = new Vector2(60,20); + public Texture2D emptyTex; + public Texture2D fullTex; + + //on a button press? begin a goal? + void startGoal() + { + } + + void savePersistantGoalDate(string key) + { + PlayerPrefs.SetString(key, goalDayStr); + } + + bool checkNewDay(string key) + { + string checkDay = PlayerPrefs.GetString(key); + if(checkDay == currentDayStr) + return false; + return true; + } + + void OnGUI() { + //draw the background: + GUI.BeginGroup(new Rect(barPos.x, barPos.y, barSize.x, barSize.y)); + GUI.Box(new Rect(0,0, barSize.x, barSize.y), emptyTex); + + //draw the filled-in part: + GUI.BeginGroup(new Rect(0,0, barSize.x * barDisplay, barSize.y)); + GUI.Box(new Rect(0,0, barSize.x, barSize.y), fullTex); + GUI.EndGroup(); + GUI.EndGroup(); + } + + void Update() { + //needs current points counting toward this goal (daily?) + //needs the total required points for this goal + currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); + barDisplay = Time.time*0.05f; //put actual progress here (current/total) + + if(currentDayStr != goalDayStr) + { + //check if goal is complete or not, the day is over + + barDisplay = 1.0f; + Debug.Log("DAY HAS PASSED!!"); + + } + if(checkNewDay("daily")) + { + Debug.Log("You failed your goal"); //not true if progress is actually complete! + goalDayStr = currentDayStr; + savePersistantGoalDate("daily"); + } + } +} diff --git a/MoCha/Assets/Scripts/Goals.cs.meta b/MoCha/Assets/Scripts/GetGoals.cs.meta similarity index 77% rename from MoCha/Assets/Scripts/Goals.cs.meta rename to MoCha/Assets/Scripts/GetGoals.cs.meta index dbac0c0..d0d081d 100644 --- a/MoCha/Assets/Scripts/Goals.cs.meta +++ b/MoCha/Assets/Scripts/GetGoals.cs.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 5f138b644c262457385474b2256308a7 -timeCreated: 1524165858 +guid: 040f99a891f1b4fed92f5a44e33fc47f +timeCreated: 1524166714 licenseType: Free MonoImporter: externalObjects: {} diff --git a/MoCha/Assets/Scripts/Goals.cs b/MoCha/Assets/Scripts/Goals.cs deleted file mode 100644 index 7273f2d..0000000 --- a/MoCha/Assets/Scripts/Goals.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class Goals : MonoBehaviour { - - // Use this for initialization - void Start () { - - } - - // Update is called once per frame - void Update () { - - } -} diff --git a/MoCha/ProjectSettings/ProjectVersion.txt b/MoCha/ProjectSettings/ProjectVersion.txt index 27997c5..ac7d214 100644 --- a/MoCha/ProjectSettings/ProjectVersion.txt +++ b/MoCha/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.3.1f1 +m_EditorVersion: 2017.4.0f1 From 9b7c5de38502933e2e22f405af2bcfb559b767d0 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Wed, 25 Apr 2018 13:50:59 -0500 Subject: [PATCH 02/24] Added progress bars, working on integrating the actual fitbit data and goal system --- MoCha/Assets/Scenes/Goals.unity | Bin 37360 -> 24200 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/Goals.unity index 57eb13b706c23b17a3b4dbb2394310fc1a119b25..6a614fcf236dbe67bcdef53cfb8a88e456b0044b 100644 GIT binary patch delta 1186 zcmZ9LT}V@57{{Np4_l@+b&dlwTp!jHo%_n;>>@=a=|Yq&yb>X67^r0qHr+XAh8GJ8 z25%Qu28l&o2pZ?Q=!=pdm={tvg%=@86cR#0<$9j8cd0w@p6B`ho{#rE&%3S97!uEf z3V`aZC?b;J>ttD@mG7Z|& zDaj}pwZdkHMf(`sG^-}WLOMOS@pES7!kK7M`|*>(f!M+x#Pt-yMUMm!7c;K@7BFH( zZ%Kf70b0t-ECYPO++(PzwL#}`j2Xafgm^7#3oaw)Ol-5B*3Y1W-Nj~}lv|v~d23() z$k1?WWaQ%Dwf><&cBrpX5LwIBE_J=F1#@sK+;_t@y~CLci>gu6XWh*(6}ma3s(U;!f$TQwd|XqUIk9_o zlQK1ecM6b1wu%FyL%%pT>mU}{2M|R|8^7di6WIi6H1LWux{Pj60q9a*bNC5Gc9Y`A zqen0VZG`~iXsKZdXDMVIsL_CpGw1$HEgC50EQ#VQ>I1m!oUI~zh}w#4!Sa>; z9iHy70!xkAToD8m@CV%Wbpekb-TzNcvRFv-uX9U5f1Tu!Sd&s>+1aal6vK2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{DQ}zj>GOi3xX9Os;vS*;#hq_+n6X!mAUiKdP;OpqmK#A6piOW8nMQC*k032#x@ZKY2QY%y7&qqc z{pK{lmgclTH*#^cSwn|M@H<&zSOpOtJESXROnWu9@NK!6=D!e|H!J5*b3*xNbm)C= KvLq^uasLO7m*edK From c6e0281a9ba7462cd0d919d3217779b4ca67bf46 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Wed, 25 Apr 2018 19:59:40 -0500 Subject: [PATCH 03/24] multiple progress bars, text is overlapping though --- MoCha/Assets/Scripts/GetGoals.cs | 48 +++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 0e38cfd..bd49f7b 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -9,24 +9,35 @@ using UnityEngine.UI; public class GetGoals : MonoBehaviour { - public Text objectText; + public Text goalText; - public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy/mm"); - public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy/mm"); + public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); + public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); public string prefKey; void Start () { - objectText = GetComponent (); + goalText.text = prefKey; + goalText.color = new Color(1f, 0.5f, 0.8f); currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); + Debug.Log(goalDayStr); + Debug.Log("hoauaouou"); + + if(prefKey == "daily") + savePersistantGoalDate("daily"); } + + public float goalValue; + //Progress Bar... public float barDisplay; //current progress public Vector2 barPos = new Vector2(20,190); public Vector2 barSize = new Vector2(60,20); + + //Texture the progress bar using these parameters public Texture2D emptyTex; public Texture2D fullTex; @@ -66,19 +77,36 @@ public class GetGoals : MonoBehaviour { currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); barDisplay = Time.time*0.05f; //put actual progress here (current/total) + //failed to complete goal if(currentDayStr != goalDayStr) { - //check if goal is complete or not, the day is over + Debug.Log(currentDayStr); + Debug.Log(goalDayStr); - barDisplay = 1.0f; Debug.Log("DAY HAS PASSED!!"); + //make it so user dismisses the goal instead! + //Destroy(this); + //destroy the goal and set a new one? + } - if(checkNewDay("daily")) + //goal complete + if(barDisplay >= 1.0f) { - Debug.Log("You failed your goal"); //not true if progress is actually complete! - goalDayStr = currentDayStr; - savePersistantGoalDate("daily"); + Debug.Log("Goal complete! +100pts!"); + + //destroy the goal and set a new one? + } + + //only applies if "daily" goal + if(prefKey == "daily") + { + if(checkNewDay(prefKey)) + { + Debug.Log("You failed your goal"); //not true if progress is actually complete! + goalDayStr = currentDayStr; + savePersistantGoalDate("daily"); + } } } } From 2f7f28703387a66ba9b0cf1ef4733a22c6c6ca4e Mon Sep 17 00:00:00 2001 From: asleal2 Date: Wed, 25 Apr 2018 23:16:41 -0500 Subject: [PATCH 04/24] progress bars --- MoCha/Assets/Scripts/GetGoals.cs | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index bd49f7b..f4850d9 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -16,27 +16,39 @@ public class GetGoals : MonoBehaviour { public string prefKey; + public float goalValue; + + //Progress Bar... + public float barDisplay; //current progress + public Vector2 barPos; + Vector2 barSize = new Vector2(227,20); + void Start () { - goalText.text = prefKey; - goalText.color = new Color(1f, 0.5f, 0.8f); + //goalText.text = prefKey; + goalText.color = new Color(0f, 0f, 0f); + + goalText.transform.position = new Vector2(barPos.x + 45.0f,barPos.y + 55.0f); + + + //barPos.x = goalText.transform.position.x; + //barPos.y = goalText.transform.position.y + 10.0f; + + //Debug.Log(barPos.x + " " + barPos.y); + + //barPos.x = 0; + //barPos.y = 0; + currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); Debug.Log(goalDayStr); - Debug.Log("hoauaouou"); + Debug.Log("hauaouou"); if(prefKey == "daily") savePersistantGoalDate("daily"); } - public float goalValue; - - //Progress Bar... - public float barDisplay; //current progress - public Vector2 barPos = new Vector2(20,190); - public Vector2 barSize = new Vector2(60,20); - //Texture the progress bar using these parameters public Texture2D emptyTex; public Texture2D fullTex; From 00e3956098dde5c629f581ded2475ba64f9f7a5c Mon Sep 17 00:00:00 2001 From: asleal2 Date: Wed, 25 Apr 2018 23:24:16 -0500 Subject: [PATCH 05/24] progress bars --- MoCha/Assets/Prefabs/Progress Bar.prefab | Bin 0 -> 9240 bytes ...r.prefab.meta => Progress Bar.prefab.meta} | 4 ++-- MoCha/Assets/Prefabs/ProgressBar.prefab | Bin 5292 -> 0 bytes MoCha/Assets/Scenes/Goals.unity | Bin 24200 -> 29244 bytes 4 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 MoCha/Assets/Prefabs/Progress Bar.prefab rename MoCha/Assets/Prefabs/{ProgressBar.prefab.meta => Progress Bar.prefab.meta} (72%) delete mode 100644 MoCha/Assets/Prefabs/ProgressBar.prefab diff --git a/MoCha/Assets/Prefabs/Progress Bar.prefab b/MoCha/Assets/Prefabs/Progress Bar.prefab new file mode 100644 index 0000000000000000000000000000000000000000..3e61fa49b28319b8e1a9358acbe8717135c1bdf5 GIT binary patch literal 9240 zcmeHMZH!$-8J@eJrF@nTu~5n_T|Nry(v|{(w7qvfTe{m_ceh0}O3&Usd-u?@_blh0 zd+n{n9)6S%5EG*UY9!kx5>z4vO+ZvcGzvmR6ZrulfX0u&4?2Bbd{`;9OsVYe@T=CZU3YcYhOV_!>(qbd=jStR zz+P|0pZWPi{(UbsKmX@vdfxf_s&gOR6kZ7QCFCaLSDI9KwNfEonTLpyQW^Yvpjm~F zWK`G!C=+LvlsW^M_4$4#YqS7)gPy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O6fsMnkI zjotbD=qcQ6_&(wOpWR# cpJUhDyjUhykEd%z65mbc2!6U-DQ0>0Uxu^Gp#T5? literal 0 HcmV?d00001 diff --git a/MoCha/Assets/Prefabs/ProgressBar.prefab.meta b/MoCha/Assets/Prefabs/Progress Bar.prefab.meta similarity index 72% rename from MoCha/Assets/Prefabs/ProgressBar.prefab.meta rename to MoCha/Assets/Prefabs/Progress Bar.prefab.meta index 0ce5346..2b39af1 100644 --- a/MoCha/Assets/Prefabs/ProgressBar.prefab.meta +++ b/MoCha/Assets/Prefabs/Progress Bar.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 76a3a676c97c14505abe10fa7fa30134 -timeCreated: 1524600874 +guid: 441f50f7e865a4e9c937038cedf667ee +timeCreated: 1524703581 licenseType: Free NativeFormatImporter: externalObjects: {} diff --git a/MoCha/Assets/Prefabs/ProgressBar.prefab b/MoCha/Assets/Prefabs/ProgressBar.prefab deleted file mode 100644 index f735d608f81871d1152eba96ade16bbe7630da10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5292 zcmeHLU2GIp6h5>4x?SAvmf2}#Nep8G z#;C*>1u-!x4-%0kMkC=T#y~=1cmTr#CK5$r^g-iaAdy6a_51GKyPetH7z|G)4jlHL zZ|?o>nRD;??hGOmKNFcWEF!mwOuU3&X{>KpT-Q`r-_sy}jf{*~<-mR@!#^VDE7fshM`9*`EXS0xSZ%7!iN5h>sy7aM2R6@aI68_#au~lg7#$TOzl^*q`Gq zpZ6nj7Cf`y-vr~VdQ6#I1Y;9?@@Os}_sXOW{0{*e1FL{xD#ddi_)7TXuO#mCUYXSZ z9vbl~;wOlgEBW@P@K0Aj}os6#d#}nWmWPRVq~23C**O>zXLw`vBo9&ClZeq z^K*Sl@lVR*IuEp)zPE2OLRv zZgIN2^-hli{w@c+>z%&zpwr!&?(0vdFlR>1#o2Yh?2=A<58HjtIyD%;>WsdZi;}B} zt?J?czRI=kwAut_#7$Nx?CA@OddX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`g6!@UL!5^tXMlOr5#r*LNYIpKU69Xzw|q=>(K)WSUr zy;9FvYChACzb5B}T!lWraeF#;*Ilt`;cGmP!h F*WZ-SCJX=o diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/Goals.unity index 6a614fcf236dbe67bcdef53cfb8a88e456b0044b..9bb606e1d60bb095a40a698b2ff1446883b4865e 100644 GIT binary patch delta 3866 zcmeHKdu)?c6u;kIEw3^5=w2|Z4%RJDz81zd!j$P$vW>2Lbq@xmLLI}k9c@`w5^WKA z$3?i16(zbQKK{TUrqMreBs``fi3ys3B;Xv05kz7(V9w@)9x=Fbk$bedS!h4*7eEowE;RZH3A8h5E9B)s0i#ELe9Z=Q;|nk zn=|S5>J<94SxeuoHc*dQD6Ioem2^hBex*Z&mp`JLT3BWpW-eusOF zlL^e7gvbwNCGkRHB%?enS?CzuqYdu8SI5@ z0Aqk%1w(kKr>@`3Ml1wMSujq4{sqUvfaQaXdw9I*qg)usalp312&TvhjxB?QUME39 zrU7`8gJ%J30XZ4^DUKOnb=jF=j)ehh2hMcpsUL275(aVuu+1={ku;8BT3JC(fu7E> zvw-1x7*$4)gG<4S1^`l_>o^t$YzX8u=M*>fxO@a04rf@aa-q`2iGI0PX~`Vwp=WLJt9Pe4Zj4TAy29WLVmeD_2NI! zu)co2Szd%ZocE`eEX6q{)@a~koDw)WV%@igIfwI-m#6f=5J!?|g(W8?)!zKO@5Zy* z_g+g}(rkX?5N)#56?{LIdj9;DtyTT|uNqbl3}0r6N-D<_gMGHDcMkf*(<7dq-{R;+ z%hy6e5-``N(DMbK$269;hlO~0xxE%XO)Ia= zW_H1ZoUCY0K1Q6gqoSAV(rD?b(qOd1@&QFVEaS4nxDvK#efcb-^<_LtpI))fNXD9) zScmr6jFVNOj$X25DWThHhPzouYnoLIce82@WDKbpBhALe6ISx#v6fx-dXL9n>s{;g zvV<~Wgo-x7r?0kTKh}$S%U;pd+2M9M z-G1qEk&c62vrT4uaArnL%U|2V0=_9PI=oho<dX%nR>6Hzl{jK)zWsXw3 z--^O_Zl1}kO0$Vj9#zzXSJVQQBzHdUkzFj!O=arzisnYAx%^u|$&=DNDCIfcgK+1? zu2c9AffsQ}nx3|>(1z-Fv2mk;8 delta 951 zcmZ9LT}V@57{{M?&be~gX|8pmfOvuCQG^#pU0MH^y_1eFJo`WY-+A7zJ?A|C!unq@ zh3L=(QM8|kHXxrLP&~~2v~bjGCQDSiIpuxpb@bvPF>@*CcQTuKW{;l5vdpo)`FYIF z9|e|~%AZAy#A0oYs3WJ1Xo(Tok!!Pka2PP>AlZnWlEuNEz&j8{l4&UDfzLq<^QJWr z8V0)t6?1P(reRVsyc2OJ%@Wiip_p}77WRV;!mmY)Nan-pnN7AP;!)+ii(DLzI?hfPZaeY5{(5-ov+cflgPV;FJ31>*b&gC|XFvGP z9{;XX_N6=fVbMJ|clql6p<5{}cJIxCjaM6+dB~W+JMzmoz_@bUsfa#_!xYVq_l`yt z;yqnzfq=nse?_RgG>CL%SPFfuswNs5^6TMXNH5h_%F>CYc)m;3M5jvvVSicKu3(vE z-Bm|OwidfAvm+<1;AWfE^T|~Oyr->zM+`eYgNE)+$W+s4YR}=ZZYPX~R~@l)C93h7 zs3FR@uft=GM=Kcr(d^`Pu|a0z3$c3q29AE^lg$pit25{#-+io3{r_a*rkStnA3~PJ A(f|Me From 1d11f0c3dddd4ccc2a7210606c80da5c48faa097 Mon Sep 17 00:00:00 2001 From: Darrel Marek Date: Thu, 26 Apr 2018 00:18:01 -0500 Subject: [PATCH 06/24] Piped pedometer steps into goals --- MoCha/Assets/Scenes/Goals.unity | Bin 29244 -> 30804 bytes MoCha/Assets/Scripts/GetGoals.cs | 44 +++++++++++++++-------- MoCha/ProjectSettings/ProjectVersion.txt | 2 +- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/Goals.unity index 9bb606e1d60bb095a40a698b2ff1446883b4865e..167c118fddf4f319d43d1df0c388c6ccd654e8d7 100644 GIT binary patch delta 1229 zcma))Ur1A76u{4&cWdS{bN<(C`G+LtpUu)q*_xJ?Y%tnvL8eakSFhWW2^Pgxy_rva zJrq=E2t^N3T>>K^Bch0)2&tC{gP;dP=9>_-&e`sjQi9GnJLmhIKi|3E_sxCd77|=F zz=Xl>PIQg!m`f)W@9$mwnP|HGh(p@91HpbWS!v%{MO3XK*TUrma-XRf@Crt6VIpZ%v)gY8F5czlRPCYSS#B0hq&O z4k{6FNoPYm0E3f1a96CR7QiQ^s2?&Ntocy_K&&x!{0JbgH`I1AaZGphv5#Snk& z^L;!B@Vc#0RJUWbnG{p1isT#PkdS1crY6E5n|JYSzME&`y*k`Q&3?GlqP71mhXEB0 zf%CEb0}Gk*pvBA`c&DQAYa7_|piy>1!8Nzn^MNH!=CMU@F1t0xzRI8rA mf?V;hVjt5C2^$&&IMF7Qa%*!G{?8mfRuBMh1;tq`f delta 571 zcmaKoF-SsD6o$_&Eh`nXR~a@46-B1KCyEV01uaEVkf4LnqNYAU5hDn}T5CKFjV}mV zi?_PuPz^y24nmDBQA0z6L-;zEUggyAbME=>fB$>#t-rI%Gn)Vij{+3t0id7OB31B- zQqb%7ib)Atnx-+~YGP@jtH8Gms+G`4ce|R{;l2j3Wg|c@t!I5_8O~e+4Xm?}I9cXQ907Qu zmvLVgiIHAf=0{D#YGfLlk*azVwVJUMGpVKIJ;U0T0ZWM~EXHh@O;rs1RXCHbV>InX zcgBMGZ2^^(8I_y^@6vvJ%gy0aCfnUf$(~>U*X0BX@~B#qm5!dDKXIUxe)uQi+{Az1 lBl!ZjA; Date: Thu, 26 Apr 2018 00:55:51 -0500 Subject: [PATCH 07/24] Progress bar hooked up with pedometer --- MoCha/Assets/Scenes/Goals.unity | Bin 30804 -> 30460 bytes MoCha/Assets/Scripts/GetGoals.cs | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/Goals.unity index 167c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ECx<>JJMU1UdGB5H332V|KV#z$i!-`lLtyT2SqB6hE@9O*O#vfm9%5|2GN-;5| Date: Thu, 26 Apr 2018 01:18:08 -0500 Subject: [PATCH 08/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 1a993e0..1ab1556 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -7,22 +7,19 @@ using UnityEngine.UI; //Pretty much a copy of GetData... namespace PedometerU.Tests { - + public class GetGoals : MonoBehaviour { public Text goalText; - public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); - public string prefKey; - public float goalValue; //Progress Bar... public float barDisplay; //current progress private Vector2 barPos; - Vector2 barSize = new Vector2(227,20); + private Vector2 barSize = new Vector2(227,20); //Pedometer private Pedometer pedometer; @@ -30,11 +27,12 @@ public class GetGoals : MonoBehaviour { double userDistance; int totalSteps = 30; public Text stepText; - + void OnStep (int steps, double distance) { userSteps = steps; - stepText.text = steps.ToString (); + stepText.text = steps.ToString (); userDistance = (distance * 3.28084); + PlayerPrefs.setInt("currentSteps",userSteps); } private void OnDisable () { @@ -47,8 +45,8 @@ public class GetGoals : MonoBehaviour { // Create a new pedometer pedometer = new Pedometer(OnStep); // Reset UI - OnStep(0, 0); - + OnStep(PlayerPrefs.getInt("currentSteps"), 0); + //goalText.text = prefKey; goalText.color = new Color(0f, 0f, 0f); @@ -103,7 +101,8 @@ public class GetGoals : MonoBehaviour { //needs the total required points for this goal currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); //barDisplay = Time.time*0.05f; //put actual progress here (current/total) - barDisplay = (float)userSteps/(float)totalSteps; + barDisplay = (float)userSteps/(float)totalSteps; + //failed to complete goal if(currentDayStr != goalDayStr) { @@ -137,4 +136,5 @@ public class GetGoals : MonoBehaviour { } } } -} \ No newline at end of file + +} From eb914d25def5ffb8e6a9ae324269a1b4f5875210 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 01:20:23 -0500 Subject: [PATCH 09/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 1ab1556..aab5dff 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -32,7 +32,7 @@ public class GetGoals : MonoBehaviour { userSteps = steps; stepText.text = steps.ToString (); userDistance = (distance * 3.28084); - PlayerPrefs.setInt("currentSteps",userSteps); + PlayerPrefs.SetInt("currentSteps",userSteps); } private void OnDisable () { @@ -45,7 +45,7 @@ public class GetGoals : MonoBehaviour { // Create a new pedometer pedometer = new Pedometer(OnStep); // Reset UI - OnStep(PlayerPrefs.getInt("currentSteps"), 0); + OnStep(PlayerPrefs.GetInt("currentSteps"), 0); //goalText.text = prefKey; goalText.color = new Color(0f, 0f, 0f); From f857f2f8319b94a901321185e22fc2d9ad2f69c7 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 01:27:34 -0500 Subject: [PATCH 10/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index aab5dff..db59225 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -43,7 +43,7 @@ public class GetGoals : MonoBehaviour { void Start () { // Create a new pedometer - pedometer = new Pedometer(OnStep); + pedometer = new Pedometer(OnStep(PlayerPrefs.GetInt("currentSteps"), 0)); // Reset UI OnStep(PlayerPrefs.GetInt("currentSteps"), 0); From ced7137fd0a2000a89a2f56a81a33f20bd990b19 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 01:36:56 -0500 Subject: [PATCH 11/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index db59225..ee52978 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -25,11 +25,11 @@ public class GetGoals : MonoBehaviour { private Pedometer pedometer; int userSteps; double userDistance; - int totalSteps = 30; + int totalSteps = 100; public Text stepText; void OnStep (int steps, double distance) { - userSteps = steps; + userSteps = PlayerPrefs.GetInt("lastSteps") + steps; stepText.text = steps.ToString (); userDistance = (distance * 3.28084); PlayerPrefs.SetInt("currentSteps",userSteps); @@ -41,12 +41,17 @@ public class GetGoals : MonoBehaviour { pedometer = null; } + // + void Start () { // Create a new pedometer - pedometer = new Pedometer(OnStep(PlayerPrefs.GetInt("currentSteps"), 0)); + pedometer = new Pedometer(OnStep); // Reset UI + PlayerPrefs.SetInt("lastSteps",PlayerPrefs.GetInt("currentSteps")); + OnStep(PlayerPrefs.GetInt("currentSteps"), 0); + //goalText.text = prefKey; goalText.color = new Color(0f, 0f, 0f); From 0fa4abc7979cbfc49fdaf4e37732570d704cf90a Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:09:18 -0500 Subject: [PATCH 12/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index ee52978..1b26a5b 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -27,12 +27,12 @@ public class GetGoals : MonoBehaviour { double userDistance; int totalSteps = 100; public Text stepText; + private int savedSteps = 0; void OnStep (int steps, double distance) { - userSteps = PlayerPrefs.GetInt("lastSteps") + steps; stepText.text = steps.ToString (); userDistance = (distance * 3.28084); - PlayerPrefs.SetInt("currentSteps",userSteps); + PlayerPrefs.SetInt("currentSteps",userSteps + savedSteps); } private void OnDisable () { @@ -41,15 +41,16 @@ public class GetGoals : MonoBehaviour { pedometer = null; } - // + //saved value from last session loads in on START + //write usersteps + saved val to pref in ONSTEP void Start () { + savedSteps = PlayerPrefs.GetInt("currentSteps"); // Create a new pedometer pedometer = new Pedometer(OnStep); // Reset UI - PlayerPrefs.SetInt("lastSteps",PlayerPrefs.GetInt("currentSteps")); - OnStep(PlayerPrefs.GetInt("currentSteps"), 0); + OnStep(savedSteps, 0); //goalText.text = prefKey; From 5f518d40105141529997ae05dbdec443b03b8f0f Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:20:35 -0500 Subject: [PATCH 13/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 1b26a5b..089fe19 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -32,7 +32,8 @@ public class GetGoals : MonoBehaviour { void OnStep (int steps, double distance) { stepText.text = steps.ToString (); userDistance = (distance * 3.28084); - PlayerPrefs.SetInt("currentSteps",userSteps + savedSteps); + userSteps = steps + savedSteps; + PlayerPrefs.SetInt("currentSteps",userSteps); } private void OnDisable () { @@ -51,6 +52,7 @@ public class GetGoals : MonoBehaviour { // Reset UI OnStep(savedSteps, 0); + Debug.Log(savedSteps); //goalText.text = prefKey; From 37a6524ae2c1f908ec487d219916487a9b4a364b Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:35:06 -0500 Subject: [PATCH 14/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 089fe19..306811e 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -30,10 +30,10 @@ public class GetGoals : MonoBehaviour { private int savedSteps = 0; void OnStep (int steps, double distance) { - stepText.text = steps.ToString (); userDistance = (distance * 3.28084); userSteps = steps + savedSteps; PlayerPrefs.SetInt("currentSteps",userSteps); + stepText.text = userSteps.ToString (); } private void OnDisable () { From fe61c6fc4907e1b591a5c4644c4430efb7225f7a Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:39:44 -0500 Subject: [PATCH 15/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 306811e..77a47b8 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -51,7 +51,7 @@ public class GetGoals : MonoBehaviour { pedometer = new Pedometer(OnStep); // Reset UI - OnStep(savedSteps, 0); + OnStep(0, 0); Debug.Log(savedSteps); From cbc73b45460b276ee876986cf5b7318fd03f2026 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:46:35 -0500 Subject: [PATCH 16/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 77a47b8..74a5887 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -27,7 +27,7 @@ public class GetGoals : MonoBehaviour { double userDistance; int totalSteps = 100; public Text stepText; - private int savedSteps = 0; + private int savedSteps; void OnStep (int steps, double distance) { userDistance = (distance * 3.28084); @@ -51,7 +51,7 @@ public class GetGoals : MonoBehaviour { pedometer = new Pedometer(OnStep); // Reset UI - OnStep(0, 0); + //OnStep(savedSteps, 0); Debug.Log(savedSteps); From 62fbee44c8a3c685a7604b3d720f600d29a72f77 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:48:59 -0500 Subject: [PATCH 17/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 74a5887..8f8281c 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -50,6 +50,7 @@ public class GetGoals : MonoBehaviour { // Create a new pedometer pedometer = new Pedometer(OnStep); // Reset UI + stepText.text = savedSteps.ToString (); //OnStep(savedSteps, 0); Debug.Log(savedSteps); From a2d0555a526be3a95273d9d255d45a03357f9a16 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:52:47 -0500 Subject: [PATCH 18/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 8f8281c..97f2d96 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -51,6 +51,7 @@ public class GetGoals : MonoBehaviour { pedometer = new Pedometer(OnStep); // Reset UI stepText.text = savedSteps.ToString (); + userSteps = savedSteps; //OnStep(savedSteps, 0); Debug.Log(savedSteps); From 009e8ee9c968347795042e584aa1adcff3f1edf4 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 02:54:53 -0500 Subject: [PATCH 19/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 97f2d96..3ec2b29 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -130,7 +130,8 @@ public class GetGoals : MonoBehaviour { if(barDisplay >= 1.0f) { Debug.Log("Goal complete! +100pts!"); - + userSteps = 0; + PlayerPrefs.SetInt("currentSteps", userSteps); //destroy the goal and set a new one? } From 908c88ed854f6be5f213c091e6e31d5fc4727b69 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 03:03:43 -0500 Subject: [PATCH 20/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 3ec2b29..88ff3cb 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -132,6 +132,8 @@ public class GetGoals : MonoBehaviour { Debug.Log("Goal complete! +100pts!"); userSteps = 0; PlayerPrefs.SetInt("currentSteps", userSteps); + savedSteps = 0; + OnStep(0,0); //destroy the goal and set a new one? } From df378ecc505e20719794d81ac877b577e6b8386b Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 04:38:54 -0500 Subject: [PATCH 21/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index 88ff3cb..deab496 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -14,7 +14,6 @@ public class GetGoals : MonoBehaviour { public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); public string prefKey; - public float goalValue; //Progress Bar... public float barDisplay; //current progress @@ -24,16 +23,23 @@ public class GetGoals : MonoBehaviour { //Pedometer private Pedometer pedometer; int userSteps; + int userPoints; double userDistance; - int totalSteps = 100; + int stepsGoal = 100; public Text stepText; + public Text pointsText; private int savedSteps; + private int savedPoints; void OnStep (int steps, double distance) { userDistance = (distance * 3.28084); userSteps = steps + savedSteps; PlayerPrefs.SetInt("currentSteps",userSteps); stepText.text = userSteps.ToString (); + + userPoints = steps*5 + savedPoints; + PlayerPrefs.SetInt("totalPoints",userPoints); + pointsText.text = "Points: " + userPoints.ToString (); } private void OnDisable () { @@ -47,11 +53,22 @@ public class GetGoals : MonoBehaviour { void Start () { savedSteps = PlayerPrefs.GetInt("currentSteps"); + savedPoints = PlayerPrefs.GetInt("totalPoints"); // Create a new pedometer pedometer = new Pedometer(OnStep); // Reset UI stepText.text = savedSteps.ToString (); + if(PlayerPrefs.HasKey("totalPoints")) + { + pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString (); + } + else + { + PlayerPrefs.SetInt("totalPoints", 0); + pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString (); + } userSteps = savedSteps; + userPoints = savedPoints; //OnStep(savedSteps, 0); Debug.Log(savedSteps); @@ -65,7 +82,6 @@ public class GetGoals : MonoBehaviour { currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); Debug.Log(goalDayStr); - Debug.Log("hauaouou"); if(prefKey == "daily") savePersistantGoalDate("daily"); @@ -111,7 +127,7 @@ public class GetGoals : MonoBehaviour { //needs the total required points for this goal currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy"); //barDisplay = Time.time*0.05f; //put actual progress here (current/total) - barDisplay = (float)userSteps/(float)totalSteps; + barDisplay = (float)userSteps/(float)stepsGoal; //failed to complete goal if(currentDayStr != goalDayStr) @@ -133,8 +149,14 @@ public class GetGoals : MonoBehaviour { userSteps = 0; PlayerPrefs.SetInt("currentSteps", userSteps); savedSteps = 0; - OnStep(0,0); + //OnStep(0,0); + stepText.text = userSteps.ToString (); + //destroy the goal and set a new one? + savedPoints += stepsGoal*10; + PlayerPrefs.SetInt("totalPoints", savedPoints); + stepText.text = PlayerPrefs.GetInt("totalPoints").ToString (); + pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString (); } //only applies if "daily" goal From c051a6683cf5fc186ed1caf2e9f6824cc0f5c4ff Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 04:42:59 -0500 Subject: [PATCH 22/24] playerpref steps --- MoCha/Assets/Scenes/Goals.unity | Bin 30460 -> 31216 bytes MoCha/ProjectSettings/ProjectVersion.txt | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/Goals.unity index 49695b6af8339f4623430aea9f151e1bd76b86dc..a2ffa524ce9d36ce864635c2e078612e32a72e93 100644 GIT binary patch delta 424 zcmezKmhr=9Mi~Z%gaQVJ$`1?-41z%R1R%{|WMF8nXQF4YQD$Ncqsr!WF+}1W~ckp3Oy7cc+-!ud}H delta 122 zcmezHneoqCMi~Z%1O*0$vOf$A41z$m1CVAgGB7mPGuAWQC^IpJQDO7Cm@FpI4M1^r zAoev-uLr5w0aVShxi&sqh>>aX%R>3dbJ92_%M>|s=-SGG Date: Thu, 26 Apr 2018 04:54:43 -0500 Subject: [PATCH 23/24] playerpref steps --- MoCha/Assets/Scripts/GetGoals.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/MoCha/Assets/Scripts/GetGoals.cs b/MoCha/Assets/Scripts/GetGoals.cs index deab496..4bd0122 100644 --- a/MoCha/Assets/Scripts/GetGoals.cs +++ b/MoCha/Assets/Scripts/GetGoals.cs @@ -155,7 +155,6 @@ public class GetGoals : MonoBehaviour { //destroy the goal and set a new one? savedPoints += stepsGoal*10; PlayerPrefs.SetInt("totalPoints", savedPoints); - stepText.text = PlayerPrefs.GetInt("totalPoints").ToString (); pointsText.text = "Points: " + PlayerPrefs.GetInt("totalPoints").ToString (); } From 483a166193738de7671e60f572542c14d16290d5 Mon Sep 17 00:00:00 2001 From: asleal2 Date: Thu, 26 Apr 2018 04:58:15 -0500 Subject: [PATCH 24/24] playerpref steps --- MoCha/Assets/Scenes/{Goals.unity => MyGoals.unity} | Bin .../Scenes/{Goals.unity.meta => MyGoals.unity.meta} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename MoCha/Assets/Scenes/{Goals.unity => MyGoals.unity} (100%) rename MoCha/Assets/Scenes/{Goals.unity.meta => MyGoals.unity.meta} (100%) diff --git a/MoCha/Assets/Scenes/Goals.unity b/MoCha/Assets/Scenes/MyGoals.unity similarity index 100% rename from MoCha/Assets/Scenes/Goals.unity rename to MoCha/Assets/Scenes/MyGoals.unity diff --git a/MoCha/Assets/Scenes/Goals.unity.meta b/MoCha/Assets/Scenes/MyGoals.unity.meta similarity index 100% rename from MoCha/Assets/Scenes/Goals.unity.meta rename to MoCha/Assets/Scenes/MyGoals.unity.meta