Skip to content

Commit

Permalink
points for ID, postcard notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
ameliajmoser committed Sep 25, 2024
1 parent 2ea333b commit f4a72f4
Show file tree
Hide file tree
Showing 17 changed files with 4,936 additions and 2,930 deletions.
35 changes: 35 additions & 0 deletions Assets/PointsMgr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using BeauUtil;
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

namespace AstroLab {
public class PointsMgr : MonoBehaviour {

public static PointsMgr Instance;

[NonSerialized] public int CurrentXP;

[SerializeField] private TMP_Text m_XPText;

private void Awake() {
if (Instance == null) {
Instance = this;
} else if (this != Instance ) {
Destroy(gameObject);
return;
}
}

public void AddXP(int add) {
CurrentXP = Math.Max(0, CurrentXP + add);
UpdateText();
}

public void UpdateText() {
m_XPText.SetText(CurrentXP.ToStringLookup());
}
}
}
11 changes: 11 additions & 0 deletions Assets/PointsMgr.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f4a72f4

Please sign in to comment.