Reworked (bad)notification system
- Reduced huge amount of fluff logic, loops, conditionals - Fixed infinite loop within 4+ calls to SendNotification() -- Replaced with new function MakePopup(string contents) -- Spawns a prefab, can call as much as you want (overlapping issue) -Add combining of colliding Popups with similar contents (exp) -- Add a tag passed into MakePopup() as argument used to combine similar values ( and increase time left to Destroy(), raise speed of transform to move away from other popups) - Popups rotate within a range of -4 to 4 for trendy not-perfect look *shrug*
This commit is contained in:
@@ -20,15 +20,21 @@ public class ExperienceBar : MonoBehaviour {
|
||||
private float lerpSpeed;
|
||||
[SerializeField]
|
||||
private int clicks;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject eventSystem;
|
||||
|
||||
|
||||
private float clicksNeeded = 10;
|
||||
private float previousExpRequired;
|
||||
private float barMovement;
|
||||
private float barPosition;
|
||||
private float Increment = 10;
|
||||
private string notify;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
eventSystem = GameObject.Find("EventSystem");
|
||||
fillAmount = currentExp / currentRequirement;
|
||||
}
|
||||
|
||||
@@ -60,6 +66,9 @@ public class ExperienceBar : MonoBehaviour {
|
||||
++clicks;
|
||||
currentExp = currentExp + Increment;
|
||||
fillAmount = currentExp / currentRequirement;
|
||||
notify = "+" + Increment + "EXP";
|
||||
eventSystem.GetComponent<GameManager>().MakePopup(notify);
|
||||
|
||||
//Debug.Log("fillAmount = " + fillAmount);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user