Skip to content
Snippets Groups Projects
Commit 2c34e245 authored by maikeljh's avatar maikeljh
Browse files

[Fix] Coins

parent 91375bbd
Branches
Tags
No related merge requests found
......@@ -22,7 +22,6 @@ public class GameData
public string timestamp;
public bool isShopKeeper;
public float increment;
public int currentReward;
// Constructor buat default values kalau new game
public GameData()
......@@ -43,7 +42,6 @@ public class GameData
this.timestamp = string.Empty;
this.isShopKeeper = false;
this.increment = 50;
this.currentReward = 1;
}
public GameData(int currentScene)
......@@ -64,7 +62,6 @@ public class GameData
this.timestamp = string.Empty;
this.isShopKeeper = false;
this.increment = 50;
this.currentReward = 1;
}
}
......@@ -7,27 +7,20 @@ public class RewardManager : MonoBehaviour, IDataPersistence
{
public PlayerCoin coins;
public float increment = 50;
public int currentReward = 1;
public void Reward()
{
if (LevelManager.Instance.currentQuest >= currentReward)
{
coins.coin += increment;
increment += 50;
currentReward = LevelManager.Instance.currentQuest + 1;
}
coins.coin += increment;
increment += 50;
}
public void LoadData(GameData data)
{
this.increment = data.increment;
this.currentReward = data.currentReward;
}
public void SaveData(ref GameData data)
{
data.increment = this.increment;
data.currentReward = this.currentReward;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment