fixed
This commit is contained in:
@@ -7,7 +7,6 @@ public class TimeAliveMoney : MonoBehaviour
|
||||
public TMP_Text moneyText;
|
||||
public TMP_Text totalMoneyText;
|
||||
public Player player;
|
||||
private bool isAlive = true;
|
||||
private float timeAlive = 0f;
|
||||
private float totalMoneyEarned = 0f;
|
||||
|
||||
@@ -19,7 +18,7 @@ public class TimeAliveMoney : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (player.gameStarted && isAlive == true) {
|
||||
if (player.gameStarted && player.isAlive == true) {
|
||||
timeAlive += Time.deltaTime;
|
||||
float earnedMoney = timeAlive * moneyPerSecond;
|
||||
if (moneyText != null)
|
||||
@@ -29,7 +28,6 @@ public class TimeAliveMoney : MonoBehaviour
|
||||
|
||||
public void OnPlayerDeath()
|
||||
{
|
||||
isAlive = false;
|
||||
totalMoneyEarned += timeAlive * moneyPerSecond;
|
||||
SaveMoney();
|
||||
timeAlive = 0f;
|
||||
|
||||
Reference in New Issue
Block a user