From 22c303d686a38154f04872ef9f2cf12920b24624 Mon Sep 17 00:00:00 2001 From: Shaun M Reed Date: Tue, 5 Sep 2017 21:41:56 -0400 Subject: [PATCH] improvements to notifications Handles popup collision -Levelups tossed to the left -Exp values combined into one popup --Add EXP/s or EXP/min? --- Assets/Prefabs/Pop-up Panel.prefab | Bin 11776 -> 13528 bytes Assets/Scenes/Main.unity | Bin 113552 -> 114392 bytes Assets/Scripts/ExperienceBar.cs | 26 +++++-- Assets/Scripts/GameManager.cs | 38 +++++++--- Assets/Scripts/PopupNotification.cs | 114 ++++++++++++++++++++++++++-- 5 files changed, 155 insertions(+), 23 deletions(-) diff --git a/Assets/Prefabs/Pop-up Panel.prefab b/Assets/Prefabs/Pop-up Panel.prefab index 1788eaddd84a791c2121d3533719cbddbd23f786..7b1e0cb552d1fca8909830e8d4fbbd6cc2eaf65b 100644 GIT binary patch delta 1489 zcmZ8hZ%kWN6hDtrRuJbKP|94!N?}{OcKnfl&alz7-Nv#(igt@}TgJ0I>&yBF+cGIJ z0W~v=#sqewGR&Mr{A6NEP~!&^yF@c$rXl)a7@Yy4(HWiiLB1GMf9JK`$j-~jJ?D4s zIrrZ4yZ4QsUeaWu#z~^KB_i4aJ3T2^Nu_f;f8Ny80f@5Mw&~A*FkR?aKVd2VvHj{_ zjg>&Bp+y{qbP|nsV-(934N{r-vv`|i6?K&s$sy{DO|bioY`<8^_MDEllva+-Ang&P z6+<6@vPk$C-v^uVat0v<+zp%Y2cayCAIJPY-6qDXXOWX+DT$k|>ck)X&~Ut9@cI2a8L zhn0BVJCRV2#Fg_}GKJ95#4# zqCPdL29q%8ATOQGrWft2&Hwff>=Kt&S5MygqNWD$dFVz)xFtFx$s?rFh zXq1^!nZ|jODP3m1{_(3_#+68W*WWJ;+&Xl-cNbPm&3|2SvuOVe+USAH$E(#hkvl%) z$MX1&4R{aQ(holi!NW0Iq&lILSR|X6tg^J!BO>W4=>(mD&6OLVEQKc%h0XX*@!|F+ zVXuC;BchB1vM^S#yAWT{-p zyBo%?==Jf2KDnBHd(BAv?|3ect+j0Fc)2)3er(PStO(k0ye7Qkm0xKBm><3Y`qWKNMS$^x>lyni8jCmzQee~@g-^^~dnhjIP zvSZRFDD7G4yxnXuWHw-)nXi1V|F#=`12&5(d{dX+D}Al=R;^(I)u$K}-|xOI0uHN4 z+hws}cS$AUAA2jmDJmR>?ZP31-LWXFPE+yp<;&e775^NPDmv;KDhYV p%DPy09oDbLV;}YGztS|^eWdL51DJ*a{Oet~ws_-Hacb}T{{vr!Ko$T1 delta 423 zcmcbS*$^YZz@X8|z@Wzf1cE^Jf{6kmjO-g#pRjL^=UvYwcGzs{m(VWdjwwDxaw1Xn z5lTRHehiy?c-@#LXGu-q^*Pnb( zT8cX-KRGeSFTW%+t#Y%T%s~MrE{4e;bX4kFfqEH%*lpYV4YNP6G8_Q13!!3Bx-LzZ zuTN#P04h)cVkV&Yk_{&|Rte2uOaO9XfP7{kp5{F7!Sw7Ij0b>X0zh>vK(R}2&Mo0n z5M{mqRGT0L@=@egFUf diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index c490b9a3a44138933cf3593da22edf07382ea141..de0ce7a294f9b40038779eb29b2e0d1e8f87d601 100644 GIT binary patch delta 6639 zcmYk>33O9c8VB$jED)ebRA8c_hSnvHD8T`(!_wdy7qDjp3{bGBg%lJcw6<08rIe+z zNHJg|h*k%+Dq#^ip+0 zJiqyVhqa(&wob3yU6gu|Ef&&hVKG=YT#IPlu1fWD*tJoMX+b=oyKy?MUk~kd;-(_7 zGTe3WQ?z#25xhPVm-@th&Qh(}N`>(nxzteS2z^rp-Ic1uT{j*^OTkQM@@XMt)SWpC z&-rPw9@3ey&USQHsRYb)W*jXKGaXY_W_06;DWC~hNYmXlqldigUe_Q zutvPr)mlyqqGv92uqW&(S_m&pyzi|QgLKtYEztDv7|q#BMtq!B4;#qx|3GW$Edi%Y zzRr%P{vh!}vBkQZ~`rI4%)JV6KM_S zO1zG_z4dIV6bu!#>=Je&7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ienceBar.cs +++ b/Assets/Scripts/ExperienceBar.cs @@ -29,7 +29,8 @@ public class ExperienceBar : MonoBehaviour { private float previousExpRequired; private float barMovement; private float barPosition; - private float Increment = 10; + [SerializeField] + public float expIncrement = 10.0f; private string notify; // Use this for initialization @@ -41,7 +42,7 @@ public class ExperienceBar : MonoBehaviour { // Update is called once per frame void Update () { fillAmount = currentExp / currentRequirement; - + this.gameObject.GetComponentInChildren().text = (int)currentExp + " / " + (int)currentRequirement; if (currentLevelText.GetComponent().text != currentLevel.ToString()){ currentLevelText.GetComponent().text = currentLevel.ToString(); @@ -56,7 +57,7 @@ public class ExperienceBar : MonoBehaviour { if (expBarSprite.fillAmount >= 1.0f) { LevelUp(); - clicksNeeded = (currentRequirement - currentExp) / Increment; + clicksNeeded = (currentRequirement - currentExp) / expIncrement; fillAmount = 0; } } @@ -64,10 +65,10 @@ public class ExperienceBar : MonoBehaviour { public void ExpMore() { ++clicks; - currentExp = currentExp + Increment; + currentExp = currentExp + expIncrement; fillAmount = currentExp / currentRequirement; - notify = "+" + Increment + "EXP"; - eventSystem.GetComponent().MakePopup(notify); + notify = "+" + expIncrement + "EXP"; + eventSystem.GetComponent().RewardPopup(expIncrement, 1); //Debug.Log("fillAmount = " + fillAmount); } @@ -75,11 +76,15 @@ public class ExperienceBar : MonoBehaviour { public void LevelUp() { ++currentLevel; + expIncrement += 10; currentLevelText.GetComponent().text = currentLevel.ToString(); previousExpRequired = currentRequirement; currentExp -= previousExpRequired; currentRequirement = Mathf.Pow(currentRequirement, 1.05f); GameObject.FindGameObjectWithTag("Player").GetComponent().RaiseRotationSpeed(); + notify = "Level " + currentLevel + "!"; + eventSystem.GetComponent().RewardPopup(currentLevel, 2); + } public void ResetExp() @@ -88,17 +93,24 @@ public class ExperienceBar : MonoBehaviour { currentLevelText.GetComponent().text = currentLevel.ToString(); currentExp = 0; fillAmount = 0; + expIncrement = 10.0f; currentRequirement = 100; clicksNeeded = 10; clicks = 0; + notify = "EXP Reset"; + eventSystem.GetComponent().MakeStringPopup(notify, 1); + } public void ExpLess() { --clicks; - currentExp = currentExp - Increment; + currentExp = currentExp - expIncrement; fillAmount = (currentExp / currentRequirement); Debug.Log("fillAmount = " + fillAmount); + notify = "-" + expIncrement + "EXP"; + eventSystem.GetComponent().RewardPopup(-expIncrement, 1); + } public float GetExperience() diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index d2a5cbd..4949b87 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -18,7 +18,8 @@ public class GameManager : MonoBehaviour { public float experience; public float requirement; public float speed; - public float increment; + public float speedIncrement; + public float expIncrement; public float rotationsPerSec; public DateTime currentTime; @@ -61,13 +62,15 @@ public class GameManager : MonoBehaviour { float rotationPerSec = GameObject.FindGameObjectWithTag("Player").GetComponent().rotationPerSec; float currentSpeed = GameObject.FindGameObjectWithTag("Player").GetComponent().currentSpeed; float currentIncrement = GameObject.FindGameObjectWithTag("Player").GetComponent().currentIncrement; + float currentExpIncrement = GameObject.FindGameObjectWithTag("ExpGained").GetComponent().expIncrement; PlayerData data = new PlayerData(); data.level = currentLevel; data.experience = currentExp; data.requirement = currentRequirement; data.speed = currentSpeed; - data.increment = currentIncrement; + data.speedIncrement = currentIncrement; + data.expIncrement = currentExpIncrement; data.rotationsPerSec = rotationPerSec; data.currentTime = System.DateTime.Now; @@ -87,20 +90,20 @@ public class GameManager : MonoBehaviour { GameObject.FindGameObjectWithTag("Player").GetComponent().rotationPerSec = data.rotationsPerSec; GameObject.FindGameObjectWithTag("Player").GetComponent().currentSpeed = data.speed; - GameObject.FindGameObjectWithTag("Player").GetComponent().currentIncrement = data.increment; + GameObject.FindGameObjectWithTag("Player").GetComponent().currentIncrement = data.speedIncrement; + GameObject.FindGameObjectWithTag("ExpGained").GetComponent().expIncrement = data.expIncrement; GameObject.FindGameObjectWithTag("ExpGained").GetComponent().currentLevel = data.level; GameObject.FindGameObjectWithTag("ExpGained").GetComponent().currentExp = data.experience; GameObject.FindGameObjectWithTag("ExpGained").GetComponent().currentRequirement = data.requirement; DateTime loadTime = System.DateTime.Now; int secondsPassed = GetIdleTime(data.currentTime, loadTime); - idleExp = (data.rotationsPerSec * secondsPassed) * data.increment; + idleExp = (data.rotationsPerSec * secondsPassed) * data.expIncrement; GameObject.FindGameObjectWithTag("ExpGained").GetComponent().currentExp += idleExp; if (idleExp >= 0.0f) { - string notification = ("+" + idleExp + "EXP"); - MakePopup(notification); + RewardPopup(idleExp, 1); } Debug.Log("Loaded"); @@ -134,16 +137,31 @@ public class GameManager : MonoBehaviour { return secondsPassed; } - public void MakePopup(string content) + + public int notificationType; + public float noteValue; + /* + * type 1 = exp + * type 2 = level + * + * + * + * + */ + public void RewardPopup(float value, int type) { - notify = content; + notificationType = type; + noteValue = value; Instantiate(popup, popupSpawn.transform.position, popupSpawn.transform.rotation, GameObject.Find("Notification Panel").gameObject.transform ); Debug.Log("Popup Created"); } - public string GetNotify() + public void MakeStringPopup(string content, int type) { - return notify; + notify = content; + notificationType = type; + Instantiate(popup, popupSpawn.transform.position, popupSpawn.transform.rotation, GameObject.Find("Notification Panel").gameObject.transform); + Debug.Log("Popup Created"); } } diff --git a/Assets/Scripts/PopupNotification.cs b/Assets/Scripts/PopupNotification.cs index 4ec8742..aaa7d31 100644 --- a/Assets/Scripts/PopupNotification.cs +++ b/Assets/Scripts/PopupNotification.cs @@ -6,20 +6,33 @@ using UnityEngine.UI; public class PopupNotification : MonoBehaviour { + public bool move = false; public bool active = false; public Vector3 origin; public float timer = 0.0f; + public float maxTimer = 3.0f; + public float speed = 50.0f; public string localNotify; + public int notificationType; + public float localValue; + // Use this for initialization void OnEnable () { active = true; + + //Get & set random rotation double randomRotation = GetRandomNumber(-4.0, 4.0); transform.Rotate(0.0f, 0.0f, (float)randomRotation); - Debug.Log("Rotation set to :" + randomRotation); - origin = this.transform.localPosition; - localNotify = GameObject.Find("EventSystem").GetComponent().GetNotify(); + //Debug.Log("Rotation set to :" + randomRotation); + + // + notificationType = GameObject.Find("EventSystem").GetComponent().notificationType; + //localNotify = GameObject.Find("EventSystem").GetComponent().notify; + localValue = GameObject.Find("EventSystem").GetComponent().noteValue; + + CheckNotificationType(); } // Update is called once per frame @@ -28,15 +41,70 @@ public class PopupNotification : MonoBehaviour { timer += 0.02f; - this.gameObject.transform.Translate(new Vector3(0, 50f * Time.deltaTime, 0)); - this.gameObject.GetComponentInChildren().text = localNotify; - if (timer >= 3) + if (timer >= maxTimer) { active = false; timer = 0.0f; + Destroy(this.gameObject); } + + if(move == true) + { + this.gameObject.transform.Translate(new Vector3(-5.0f, speed * Time.deltaTime, 0)); + this.gameObject.GetComponentInChildren().text = localNotify; + } + else + { + this.gameObject.transform.Translate(new Vector3(0, speed * Time.deltaTime, 0)); + this.gameObject.GetComponentInChildren().text = localNotify; + } + } + + void OnCollisionEnter (Collision col) + { + if(col.gameObject.GetComponent().notificationType == 1 && notificationType == 1) + { + //if both colliding popus are EXP related + + + if ((maxTimer - timer) > (col.gameObject.GetComponent().maxTimer - col.gameObject.GetComponent().timer)) + { + //If this Popup has more time left than colliding popup + localValue += col.gameObject.GetComponent().localValue; + maxTimer += 0.5f; + CheckNotificationType(); + Destroy(col.gameObject); + }//else do nothing, let other popup handle it + } + else if (col.gameObject.GetComponent().notificationType == 2 && notificationType == 2) + { + //if both colliding popus are level related + + + if (localValue > col.gameObject.GetComponent().localValue) + { + //If this popup is of higher level + Destroy(col.gameObject); + }//Destroy collider, show most recent level + maxTimer += 1.0f; + CheckNotificationType(); + + } + else if (col.gameObject.GetComponent().notificationType != notificationType) + { + //if both colliding popus are not related + + + if (notificationType == 2) + { + move = true; + }//else do nothing, let other popup handle it + } + + + } public double GetRandomNumber(double min, double max) @@ -45,5 +113,39 @@ public class PopupNotification : MonoBehaviour { return random.NextDouble() * (max - min) + min; } + public void CheckNotificationType() + { + //If notification is of type EXP + if (notificationType == 1) + { + + if (localValue == 0) + { + Debug.Log("Null EXP value, popup discarded :" + localValue); + Destroy(this.gameObject); + } + + if (localValue > 0) + { + //If adding EXP + localNotify = "+" + localValue + "EXP"; + + } + else if (localValue < 0) + { + //If subtracting EXP + localNotify = localValue + "EXP"; + } + + } + else if (notificationType == 2) + { + //If notification is of type Level Gained + localNotify = "Level " + localValue + "!"; + } + + this.gameObject.GetComponentInChildren().text = localNotify; + } + }