Savefile change
This commit is contained in:
@@ -138,44 +138,24 @@ public class BazookaManager : MonoBehaviour
|
|||||||
return int.Parse(saveFile["bird"]["pastOverlay"].ToString());
|
return int.Parse(saveFile["bird"]["pastOverlay"].ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCustomBirdIcon(string value)
|
public void SetCustomBirdIconData(JObject value)
|
||||||
{
|
{
|
||||||
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
||||||
saveFile["bird"]["customIcon"] = value;
|
saveFile["bird"]["customIcon"] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnsetCustomBirdIcon()
|
public void UnsetCustomBirdIconData()
|
||||||
{
|
{
|
||||||
if (saveFile["bird"] == null) return;
|
if (saveFile["bird"] == null) return;
|
||||||
if (saveFile["bird"]["customIcon"] == null) return;
|
if (saveFile["bird"]["customIcon"] == null) return;
|
||||||
(saveFile["bird"] as JObject)?.Remove("customIcon");
|
(saveFile["bird"] as JObject)?.Remove("customIcon");
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetCustomBirdIcon()
|
public JObject GetCustomBirdIconData()
|
||||||
{
|
{
|
||||||
if (saveFile["bird"] == null) return null;
|
if (saveFile["bird"] == null) return null;
|
||||||
if (saveFile["bird"]["customIcon"] == null) return null;
|
if (saveFile["bird"]["customIcon"] == null) return null;
|
||||||
return saveFile["bird"]["customIcon"].ToString();
|
return saveFile["bird"]["customIcon"] as JObject;
|
||||||
}
|
|
||||||
|
|
||||||
public void SetCustomBirdIconID(int value)
|
|
||||||
{
|
|
||||||
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
|
||||||
saveFile["bird"]["customIconID"] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UnsetCustomBirdIconID()
|
|
||||||
{
|
|
||||||
if (saveFile["bird"] == null) return;
|
|
||||||
if (saveFile["bird"]["customIconID"] == null) return;
|
|
||||||
(saveFile["bird"] as JObject)?.Remove("customIconID");
|
|
||||||
}
|
|
||||||
|
|
||||||
public int? GetCustomBirdIconID()
|
|
||||||
{
|
|
||||||
if (saveFile["bird"] == null) return null;
|
|
||||||
if (saveFile["bird"]["customIconID"] == null) return null;
|
|
||||||
return int.Parse(saveFile["bird"]["customIconID"].ToString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Settings stuff
|
//Settings stuff
|
||||||
@@ -512,4 +492,23 @@ public class BazookaManager : MonoBehaviour
|
|||||||
if (saveFile["gameStore"] == null) return;
|
if (saveFile["gameStore"] == null) return;
|
||||||
(saveFile["gameStore"] as JObject)?.Remove("totalSpeedyBerries");
|
(saveFile["gameStore"] as JObject)?.Remove("totalSpeedyBerries");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalCoinBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalCoinBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalCoinBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalCoinBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalCoinBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalCoinBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalCoinBerries");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
private BigInteger totalSlowBerries;
|
private BigInteger totalSlowBerries;
|
||||||
private BigInteger totalUltraBerries;
|
private BigInteger totalUltraBerries;
|
||||||
private BigInteger totalSpeedyBerries;
|
private BigInteger totalSpeedyBerries;
|
||||||
|
private BigInteger totalCoinBerries;
|
||||||
private BigInteger totalAttempts;
|
private BigInteger totalAttempts;
|
||||||
private float boostLeft;
|
private float boostLeft;
|
||||||
private float slownessLeft;
|
private float slownessLeft;
|
||||||
@@ -79,6 +80,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
totalSlowBerries = BazookaManager.Instance.GetGameStoreTotalSlowBerries();
|
totalSlowBerries = BazookaManager.Instance.GetGameStoreTotalSlowBerries();
|
||||||
totalUltraBerries = BazookaManager.Instance.GetGameStoreTotalUltraBerries();
|
totalUltraBerries = BazookaManager.Instance.GetGameStoreTotalUltraBerries();
|
||||||
totalSpeedyBerries = BazookaManager.Instance.GetGameStoreTotalSpeedyBerries();
|
totalSpeedyBerries = BazookaManager.Instance.GetGameStoreTotalSpeedyBerries();
|
||||||
|
totalCoinBerries = BazookaManager.Instance.GetGameStoreTotalCoinBerries();
|
||||||
totalAttempts = BazookaManager.Instance.GetGameStoreTotalAttepts();
|
totalAttempts = BazookaManager.Instance.GetGameStoreTotalAttepts();
|
||||||
|
|
||||||
Cursor.visible = false;
|
Cursor.visible = false;
|
||||||
@@ -646,6 +648,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
BazookaManager.Instance.SetGameStoreTotalSlowBerries(totalSlowBerries);
|
BazookaManager.Instance.SetGameStoreTotalSlowBerries(totalSlowBerries);
|
||||||
BazookaManager.Instance.SetGameStoreTotalUltraBerries(totalUltraBerries);
|
BazookaManager.Instance.SetGameStoreTotalUltraBerries(totalUltraBerries);
|
||||||
BazookaManager.Instance.SetGameStoreTotalSpeedyBerries(totalSpeedyBerries);
|
BazookaManager.Instance.SetGameStoreTotalSpeedyBerries(totalSpeedyBerries);
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalCoinBerries(totalCoinBerries);
|
||||||
BazookaManager.Instance.SetGameStoreTotalAttepts(totalAttempts);
|
BazookaManager.Instance.SetGameStoreTotalAttepts(totalAttempts);
|
||||||
scoreText.text = $"Score: {Tools.FormatWithCommas(score)} \\u2022 Attempts: {Tools.FormatWithCommas(attempts)}";
|
scoreText.text = $"Score: {Tools.FormatWithCommas(score)} \\u2022 Attempts: {Tools.FormatWithCommas(attempts)}";
|
||||||
highScoreText.text = $"High Score: {Tools.FormatWithCommas(highscore)} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
highScoreText.text = $"High Score: {Tools.FormatWithCommas(highscore)} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
||||||
|
|||||||
Reference in New Issue
Block a user