-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ea333b
commit f4a72f4
Showing
17 changed files
with
4,936 additions
and
2,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.