Bazooka Manager is basically complete now (after 2+ weeks) and start working on server rewrite
This commit is contained in:
@@ -37,8 +37,8 @@ public class AccountChangePassword : MonoBehaviour
|
|||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("inputPassword", changePasswordCurrentPasswordInput.text);
|
dataForm.AddField("inputPassword", changePasswordCurrentPasswordInput.text);
|
||||||
dataForm.AddField("inputNewPassword", changePasswordNewPasswordInput.text);
|
dataForm.AddField("inputNewPassword", changePasswordNewPasswordInput.text);
|
||||||
dataForm.AddField("session", PlayerPrefs.GetString("gameSession"));
|
dataForm.AddField("session", BazookaManager.Instance.GetAccountSession());
|
||||||
dataForm.AddField("userName", PlayerPrefs.GetString("userName"));
|
dataForm.AddField("userName", BazookaManager.Instance.GetAccountName());
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "changeAccountPassword.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "changeAccountPassword.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
@@ -82,7 +82,7 @@ public class AccountChangePassword : MonoBehaviour
|
|||||||
}
|
}
|
||||||
if (Regex.IsMatch(response, "^[a-zA-Z0-9]{512}$"))
|
if (Regex.IsMatch(response, "^[a-zA-Z0-9]{512}$"))
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetString("gameSession", response);
|
BazookaManager.Instance.SetAccountSession(response);
|
||||||
AccountHandler.instance.SwitchPanel(0);
|
AccountHandler.instance.SwitchPanel(0);
|
||||||
AccountHandler.UpdateStatusText(AccountHandler.instance.accountLoggedIn.loggedInText, "Password changed successfully", Color.green);
|
AccountHandler.UpdateStatusText(AccountHandler.instance.accountLoggedIn.loggedInText, "Password changed successfully", Color.green);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ public class AccountChangeUsername : MonoBehaviour
|
|||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("inputUserName", changeUsernameCurrentUsernameInput.text);
|
dataForm.AddField("inputUserName", changeUsernameCurrentUsernameInput.text);
|
||||||
dataForm.AddField("inputNewUserName", changeUsernameNewUsernameInput.text);
|
dataForm.AddField("inputNewUserName", changeUsernameNewUsernameInput.text);
|
||||||
dataForm.AddField("session", PlayerPrefs.GetString("gameSession"));
|
dataForm.AddField("session", BazookaManager.Instance.GetAccountSession());
|
||||||
dataForm.AddField("userName", PlayerPrefs.GetString("userName"));
|
dataForm.AddField("userName", BazookaManager.Instance.GetAccountName());
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "changeAccountUsername.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "changeAccountUsername.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
@@ -57,7 +57,7 @@ public class AccountChangeUsername : MonoBehaviour
|
|||||||
AccountHandler.UpdateStatusText(changeUsernameStatusText, "Can't send requests on self-built instance", Color.red);
|
AccountHandler.UpdateStatusText(changeUsernameStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
break;
|
break;
|
||||||
case "1":
|
case "1":
|
||||||
PlayerPrefs.SetString("userName", changeUsernameNewUsernameInput.text);
|
BazookaManager.Instance.SetAccountName(changeUsernameNewUsernameInput.text);
|
||||||
AccountHandler.instance.SwitchPanel(0);
|
AccountHandler.instance.SwitchPanel(0);
|
||||||
AccountHandler.UpdateStatusText(AccountHandler.instance.accountLoggedIn.loggedInText, "Username changed successfully", Color.green);
|
AccountHandler.UpdateStatusText(AccountHandler.instance.accountLoggedIn.loggedInText, "Username changed successfully", Color.green);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class AccountHandler : MonoBehaviour
|
|||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
if (PlayerPrefs.HasKey("gameSession") && PlayerPrefs.HasKey("userName") && PlayerPrefs.HasKey("userId"))
|
if (BazookaManager.Instance.GetAccountID() != null && BazookaManager.Instance.GetAccountName() != null && BazookaManager.Instance.GetAccountSession() != null)
|
||||||
{
|
{
|
||||||
SwitchPanel(0);
|
SwitchPanel(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using System.Numerics;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@@ -35,7 +37,7 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
{
|
{
|
||||||
loggedInSaveButton.interactable = true;
|
loggedInSaveButton.interactable = true;
|
||||||
loggedInLoadButton.interactable = true;
|
loggedInLoadButton.interactable = true;
|
||||||
loggedInText.text = "Logged in as: " + PlayerPrefs.GetString("userName");
|
loggedInText.text = "Logged in as: " + BazookaManager.Instance.GetAccountName();
|
||||||
}
|
}
|
||||||
|
|
||||||
async void SaveAccount()
|
async void SaveAccount()
|
||||||
@@ -43,23 +45,23 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
loggedInLoadButton.interactable = false;
|
loggedInLoadButton.interactable = false;
|
||||||
loggedInSaveButton.interactable = false;
|
loggedInSaveButton.interactable = false;
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("userName", PlayerPrefs.GetString("userName", ""));
|
dataForm.AddField("userName", BazookaManager.Instance.GetAccountName());
|
||||||
dataForm.AddField("gameSession", PlayerPrefs.GetString("gameSession", ""));
|
dataForm.AddField("gameSession", BazookaManager.Instance.GetAccountSession());
|
||||||
dataForm.AddField("highScore", PlayerPrefs.GetString("HighScoreV2", "0"));
|
dataForm.AddField("highScore", BazookaManager.Instance.GetGameStoreHighScore().ToString());
|
||||||
dataForm.AddField("icon", PlayerPrefs.GetInt("icon", 1).ToString());
|
dataForm.AddField("icon", BazookaManager.Instance.GetBirdIcon().ToString());
|
||||||
dataForm.AddField("overlay", PlayerPrefs.GetInt("overlay", 0).ToString());
|
dataForm.AddField("overlay", BazookaManager.Instance.GetBirdOverlay().ToString());
|
||||||
dataForm.AddField("totalNormalBerries", PlayerPrefs.GetString("TotalNormalBerries", "0"));
|
dataForm.AddField("totalNormalBerries", BazookaManager.Instance.GetGameStoreTotalNormalBerries().ToString());
|
||||||
dataForm.AddField("totalPoisonBerries", PlayerPrefs.GetString("TotalPoisonBerries", "0"));
|
dataForm.AddField("totalPoisonBerries", BazookaManager.Instance.GetGameStoreTotalPoisonBerries().ToString());
|
||||||
dataForm.AddField("totalSlowBerries", PlayerPrefs.GetString("TotalSlowBerries", "0"));
|
dataForm.AddField("totalSlowBerries", BazookaManager.Instance.GetGameStoreTotalSlowBerries().ToString());
|
||||||
dataForm.AddField("totalUltraBerries", PlayerPrefs.GetString("TotalUltraBerries", "0"));
|
dataForm.AddField("totalUltraBerries", BazookaManager.Instance.GetGameStoreTotalUltraBerries().ToString());
|
||||||
dataForm.AddField("totalSpeedyBerries", PlayerPrefs.GetString("TotalSpeedyBerries", "0"));
|
dataForm.AddField("totalSpeedyBerries", BazookaManager.Instance.GetGameStoreTotalSpeedyBerries().ToString());
|
||||||
dataForm.AddField("totalAttempts", PlayerPrefs.GetString("TotalAttempts", "0"));
|
dataForm.AddField("totalAttempts", BazookaManager.Instance.GetGameStoreTotalAttepts().ToString());
|
||||||
dataForm.AddField("birdR", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[0]);
|
dataForm.AddField("birdR", BazookaManager.Instance.GetColorSettingIcon()[0].ToString());
|
||||||
dataForm.AddField("birdG", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[1]);
|
dataForm.AddField("birdG", BazookaManager.Instance.GetColorSettingIcon()[1].ToString());
|
||||||
dataForm.AddField("birdB", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[2]);
|
dataForm.AddField("birdB", BazookaManager.Instance.GetColorSettingIcon()[2].ToString());
|
||||||
dataForm.AddField("overlayR", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[0]);
|
dataForm.AddField("overlayR", BazookaManager.Instance.GetColorSettingOverlay()[0].ToString());
|
||||||
dataForm.AddField("overlayG", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[1]);
|
dataForm.AddField("overlayG", BazookaManager.Instance.GetColorSettingOverlay()[1].ToString());
|
||||||
dataForm.AddField("overlayB", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[2]);
|
dataForm.AddField("overlayB", BazookaManager.Instance.GetColorSettingOverlay()[2].ToString());
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "saveAccount.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "saveAccount.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
@@ -104,8 +106,8 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
loggedInLoadButton.interactable = false;
|
loggedInLoadButton.interactable = false;
|
||||||
loggedInSaveButton.interactable = false;
|
loggedInSaveButton.interactable = false;
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("userName", PlayerPrefs.GetString("userName", ""));
|
dataForm.AddField("userName", BazookaManager.Instance.GetAccountName());
|
||||||
dataForm.AddField("gameSession", PlayerPrefs.GetString("gameSession", ""));
|
dataForm.AddField("gameSession", BazookaManager.Instance.GetAccountSession());
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loadAccount.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loadAccount.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
@@ -138,17 +140,25 @@ public class AccountLoggedIn : MonoBehaviour
|
|||||||
var split = response.Split(":");
|
var split = response.Split(":");
|
||||||
if (split[0] == "1")
|
if (split[0] == "1")
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetString("HighScoreV2", split[1]);
|
BazookaManager.Instance.SetGameStoreHighScore(BigInteger.Parse(split[1]));
|
||||||
PlayerPrefs.SetInt("icon", int.Parse(split[2]));
|
BazookaManager.Instance.SetBirdIcon(int.Parse(split[2]));
|
||||||
PlayerPrefs.SetInt("overlay", int.Parse(split[3]));
|
BazookaManager.Instance.SetBirdOverlay(int.Parse(split[3]));
|
||||||
PlayerPrefs.SetString("TotalNormalBerries", split[4]);
|
BazookaManager.Instance.SetGameStoreTotalNormalBerries(BigInteger.Parse(split[4]));
|
||||||
PlayerPrefs.SetString("TotalPoisonBerries", split[5]);
|
BazookaManager.Instance.SetGameStoreTotalPoisonBerries(BigInteger.Parse(split[5]));
|
||||||
PlayerPrefs.SetString("TotalSlowBerries", split[6]);
|
BazookaManager.Instance.SetGameStoreTotalSlowBerries(BigInteger.Parse(split[6]));
|
||||||
PlayerPrefs.SetString("TotalUltraBerries", split[7]);
|
BazookaManager.Instance.SetGameStoreTotalUltraBerries(BigInteger.Parse(split[7]));
|
||||||
PlayerPrefs.SetString("TotalSpeedyBerries", split[8]);
|
BazookaManager.Instance.SetGameStoreTotalSpeedyBerries(BigInteger.Parse(split[8]));
|
||||||
PlayerPrefs.SetString("TotalAttempts", split[9]);
|
BazookaManager.Instance.SetGameStoreTotalAttepts(BigInteger.Parse(split[9]));
|
||||||
PlayerPrefs.SetString("BirdColor", $"{split[10]};{split[11]};{split[12]}");
|
BazookaManager.Instance.SetColorSettingIcon(new JArray(
|
||||||
PlayerPrefs.SetString("OverlayColor", $"{split[13]};{split[14]};{split[15]}");
|
int.Parse(split[10]),
|
||||||
|
int.Parse(split[11]),
|
||||||
|
int.Parse(split[12])
|
||||||
|
));
|
||||||
|
BazookaManager.Instance.SetColorSettingOverlay(new JArray(
|
||||||
|
int.Parse(split[13]),
|
||||||
|
int.Parse(split[14]),
|
||||||
|
int.Parse(split[15])
|
||||||
|
));
|
||||||
AccountHandler.UpdateStatusText(loggedInText, "Loaded account data", Color.green);
|
AccountHandler.UpdateStatusText(loggedInText, "Loaded account data", Color.green);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -20,20 +20,20 @@ public class AccountLoggedOut : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (clearValues)
|
if (clearValues)
|
||||||
{
|
{
|
||||||
PlayerPrefs.DeleteKey("gameSession");
|
BazookaManager.Instance.UnsetAccountSession();
|
||||||
PlayerPrefs.DeleteKey("userName");
|
BazookaManager.Instance.UnsetAccountName();
|
||||||
PlayerPrefs.DeleteKey("userId");
|
BazookaManager.Instance.UnsetAccountID();
|
||||||
PlayerPrefs.SetString("HighScoreV2", "0");
|
BazookaManager.Instance.UnsetGameStoreHighScore();
|
||||||
PlayerPrefs.SetInt("icon", 1);
|
BazookaManager.Instance.UnsetBirdIcon();
|
||||||
PlayerPrefs.SetInt("overlay", 0);
|
BazookaManager.Instance.UnsetBirdOverlay();
|
||||||
PlayerPrefs.DeleteKey("TotalNormalBerries");
|
BazookaManager.Instance.UnsetGameStoreTotalNormalBerries();
|
||||||
PlayerPrefs.DeleteKey("TotalPoisonBerries");
|
BazookaManager.Instance.UnsetGameStoreTotalPoisonBerries();
|
||||||
PlayerPrefs.DeleteKey("TotalSlowBerries");
|
BazookaManager.Instance.UnsetGameStoreTotalSlowBerries();
|
||||||
PlayerPrefs.DeleteKey("TotalUltraBerries");
|
BazookaManager.Instance.UnsetGameStoreTotalUltraBerries();
|
||||||
PlayerPrefs.DeleteKey("TotalSpeedyBerries");
|
BazookaManager.Instance.UnsetGameStoreTotalSpeedyBerries();
|
||||||
PlayerPrefs.DeleteKey("TotalAttempts");
|
BazookaManager.Instance.UnsetGameStoreTotalAttepts();
|
||||||
PlayerPrefs.DeleteKey("BirdColor");
|
BazookaManager.Instance.UnsetColorSettingIcon();
|
||||||
PlayerPrefs.DeleteKey("OverlayColor");
|
BazookaManager.Instance.UnsetColorSettingOverlay();
|
||||||
clearValues = false;
|
clearValues = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@@ -27,10 +28,15 @@ public class AccountLogin : MonoBehaviour
|
|||||||
|
|
||||||
async void SubmitLogin()
|
async void SubmitLogin()
|
||||||
{
|
{
|
||||||
|
if (loginUsernameInput.text == string.Empty || loginPasswordInput.text == string.Empty)
|
||||||
|
{
|
||||||
|
AccountHandler.UpdateStatusText(loginPanelStatusText, "All input fields must be filled", Color.red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("username", loginUsernameInput.text);
|
dataForm.AddField("username", loginUsernameInput.text);
|
||||||
dataForm.AddField("password", loginPasswordInput.text);
|
dataForm.AddField("password", loginPasswordInput.text);
|
||||||
dataForm.AddField("currentHighScore", PlayerPrefs.GetString("HighScoreV2", "0"));
|
dataForm.AddField("currentHighScore", BazookaManager.Instance.GetGameStoreHighScore().ToString());
|
||||||
dataForm.AddField("loginType", "0");
|
dataForm.AddField("loginType", "0");
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loginAccount.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "loginAccount.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
@@ -63,39 +69,32 @@ public class AccountLogin : MonoBehaviour
|
|||||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
AccountHandler.UpdateStatusText(loginPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (response == "-1")
|
|
||||||
{
|
|
||||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Incorrect username or password", Color.red);
|
|
||||||
}
|
|
||||||
else if (response.Split(":")[0] == "1")
|
|
||||||
{
|
|
||||||
string[] array = response.Split(':');
|
|
||||||
string session = array[1];
|
|
||||||
string userName = array[2];
|
|
||||||
int userId = int.Parse(array[3]);
|
|
||||||
BigInteger highScore = BigInteger.Parse(array[4]);
|
|
||||||
int iconId = int.Parse(array[5]);
|
|
||||||
int overlayId = int.Parse(array[6]);
|
|
||||||
PlayerPrefs.SetString("gameSession", session);
|
|
||||||
PlayerPrefs.SetString("userName", userName);
|
|
||||||
PlayerPrefs.SetInt("userId", userId);
|
|
||||||
PlayerPrefs.SetString("HighScoreV2", highScore.ToString());
|
|
||||||
PlayerPrefs.SetInt("icon", iconId);
|
|
||||||
PlayerPrefs.SetInt("overlay", overlayId);
|
|
||||||
PlayerPrefs.SetString("TotalNormalBerries", array[7]);
|
|
||||||
PlayerPrefs.SetString("TotalPoisonBerries", array[8]);
|
|
||||||
PlayerPrefs.SetString("TotalSlowBerries", array[9]);
|
|
||||||
PlayerPrefs.SetString("TotalUltraBerries", array[10]);
|
|
||||||
PlayerPrefs.SetString("TotalSpeedyBerries", array[11]);
|
|
||||||
PlayerPrefs.SetString("TotalAttempts", array[12]);
|
|
||||||
PlayerPrefs.SetString("BirdColor", $"{array[13]};{array[14]};{array[15]}");
|
|
||||||
PlayerPrefs.SetString("OverlayColor", $"{array[16]};{array[17]};{array[18]}");
|
|
||||||
AccountHandler.instance.SwitchPanel(0);
|
|
||||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "", Color.red);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AccountHandler.UpdateStatusText(loginPanelStatusText, "Unknown server response", Color.red);
|
var jsonResponse = JObject.Parse(response);
|
||||||
|
if ((bool)jsonResponse["success"])
|
||||||
|
{
|
||||||
|
BazookaManager.Instance.SetAccountSession((string)jsonResponse["data"]["session"]);
|
||||||
|
BazookaManager.Instance.SetAccountName((string)jsonResponse["data"]["username"]);
|
||||||
|
BazookaManager.Instance.SetAccountID(BigInteger.Parse((string)jsonResponse["data"]["userid"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreHighScore(BigInteger.Parse((string)jsonResponse["data"]["highscore"]));
|
||||||
|
BazookaManager.Instance.SetBirdIcon((int)jsonResponse["data"]["icon"]);
|
||||||
|
BazookaManager.Instance.SetBirdOverlay((int)jsonResponse["data"]["overlay"]);
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalNormalBerries(BigInteger.Parse((string)jsonResponse["data"]["totalNormalBerries"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalPoisonBerries(BigInteger.Parse((string)jsonResponse["data"]["totalPoisonBerries"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalSlowBerries(BigInteger.Parse((string)jsonResponse["data"]["totalSlowBerries"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalUltraBerries(BigInteger.Parse((string)jsonResponse["data"]["totalUltraBerries"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalSpeedyBerries(BigInteger.Parse((string)jsonResponse["data"]["totalSpeedyBerries"]));
|
||||||
|
BazookaManager.Instance.SetGameStoreTotalAttepts(BigInteger.Parse((string)jsonResponse["data"]["totalAttempts"]));
|
||||||
|
BazookaManager.Instance.SetColorSettingIcon(JArray.Parse(jsonResponse["data"]["birdColor"].ToString()));
|
||||||
|
BazookaManager.Instance.SetColorSettingOverlay(JArray.Parse(jsonResponse["data"]["overlayColor"].ToString()));
|
||||||
|
AccountHandler.instance.SwitchPanel(0);
|
||||||
|
AccountHandler.UpdateStatusText(loginPanelStatusText, "", Color.red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AccountHandler.UpdateStatusText(loginPanelStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Numerics;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@@ -69,10 +70,10 @@ public class AccountRefreshLogin : MonoBehaviour
|
|||||||
string[] array = response.Split(':');
|
string[] array = response.Split(':');
|
||||||
string session = array[1];
|
string session = array[1];
|
||||||
string userName = array[2];
|
string userName = array[2];
|
||||||
int userId = int.Parse(array[3]);
|
BigInteger userId = BigInteger.Parse(array[3]);
|
||||||
PlayerPrefs.SetString("gameSession", session);
|
BazookaManager.Instance.SetAccountSession(session);
|
||||||
PlayerPrefs.SetString("userName", userName);
|
BazookaManager.Instance.SetAccountName(userName);
|
||||||
PlayerPrefs.SetInt("userId", userId);
|
BazookaManager.Instance.SetAccountID(userId);
|
||||||
AccountHandler.instance.SwitchPanel(0);
|
AccountHandler.instance.SwitchPanel(0);
|
||||||
AccountHandler.UpdateStatusText(refreshLoginStatusText, "", Color.red);
|
AccountHandler.UpdateStatusText(refreshLoginStatusText, "", Color.red);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@@ -34,19 +33,25 @@ public class AccountRegister : MonoBehaviour
|
|||||||
|
|
||||||
async void SubmitRegister()
|
async void SubmitRegister()
|
||||||
{
|
{
|
||||||
if (!registerEmailInput.text.Trim().Equals(registerRetypeEmailInput.text.Trim(), StringComparison.OrdinalIgnoreCase))
|
if (
|
||||||
|
registerUsernameInput.text == string.Empty ||
|
||||||
|
registerEmailInput.text == string.Empty ||
|
||||||
|
registerRetypeEmailInput.text == string.Empty ||
|
||||||
|
registerPasswordInput.text == string.Empty ||
|
||||||
|
registerRetypePasswordInput.text == string.Empty
|
||||||
|
)
|
||||||
{
|
{
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Email doesn't match", Color.red);
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "All input fields must be filled", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!registerPasswordInput.text.Trim().Equals(registerRetypePasswordInput.text.Trim(), StringComparison.OrdinalIgnoreCase))
|
if (registerEmailInput.text != registerRetypeEmailInput.text)
|
||||||
{
|
{
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Password doesn't match", Color.red);
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Emails don't match", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Regex.IsMatch(registerUsernameInput.text, "^[a-zA-Z0-9]{3,16}$"))
|
if (registerPasswordInput.text != registerRetypePasswordInput.text)
|
||||||
{
|
{
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Username must be 3-16 characters, letters and numbers only", Color.red);
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Passwords don't match", Color.red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
@@ -64,38 +69,37 @@ public class AccountRegister : MonoBehaviour
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
string response = SensitiveInfo.Decrypt(request.downloadHandler.text, SensitiveInfo.SERVER_RECEIVE_TRANSFER_KEY);
|
||||||
switch (response)
|
if (response == "-999")
|
||||||
{
|
{
|
||||||
case "-999":
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Server error while fetching data", Color.red);
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Server error while fetching data", Color.red);
|
return;
|
||||||
break;
|
}
|
||||||
case "-998":
|
else if (response == "-998")
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Client version too outdated to access servers", Color.red);
|
{
|
||||||
break;
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Client version too outdated to access servers", Color.red);
|
||||||
case "-997":
|
return;
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Encryption/decryption issues", Color.red);
|
}
|
||||||
break;
|
else if (response == "-997")
|
||||||
case "-996":
|
{
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Encryption/decryption issues", Color.red);
|
||||||
break;
|
return;
|
||||||
case "1":
|
}
|
||||||
|
else if (response == "-996")
|
||||||
|
{
|
||||||
|
AccountHandler.UpdateStatusText(registerPanelStatusText, "Can't send requests on self-built instance", Color.red);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var jsonResponse = JObject.Parse(response);
|
||||||
|
if ((bool)jsonResponse["success"])
|
||||||
|
{
|
||||||
AccountHandler.instance.SwitchPanel(2);
|
AccountHandler.instance.SwitchPanel(2);
|
||||||
break;
|
}
|
||||||
case "-1":
|
else
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Username must be 3-16 characters, letters and numbers only", Color.red);
|
{
|
||||||
break;
|
AccountHandler.UpdateStatusText(registerPanelStatusText, (string)jsonResponse["message"], Color.red);
|
||||||
case "-2":
|
}
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Email not valid", Color.red);
|
|
||||||
break;
|
|
||||||
case "-3":
|
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Password must have 8 characters, one number and one letter", Color.red);
|
|
||||||
break;
|
|
||||||
case "-4":
|
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Username or email already exists", Color.red);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
AccountHandler.UpdateStatusText(registerPanelStatusText, "Unknown server response", Color.red);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Numerics;
|
||||||
using System.Net.Security;
|
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@@ -65,11 +63,412 @@ public class BazookaManager : MonoBehaviour
|
|||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
{
|
{
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
return;
|
||||||
|
#else
|
||||||
string path = Path.Join(Application.persistentDataPath, "BazookaManager.dat");
|
string path = Path.Join(Application.persistentDataPath, "BazookaManager.dat");
|
||||||
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Newtonsoft.Json.Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
|
var encoded = SensitiveInfo.EncryptRaw(saveFile.ToString(Formatting.None), SensitiveInfo.BAZOOKA_MANAGER_KEY);
|
||||||
if (encoded == null) return;
|
if (encoded == null) return;
|
||||||
using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
|
using var fileStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
|
||||||
fileStream.Write(encoded, 0, encoded.Length);
|
fileStream.Write(encoded, 0, encoded.Length);
|
||||||
fileStream.Flush(true);
|
fileStream.Flush(true);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//Bird stuff
|
||||||
|
|
||||||
|
public void SetBirdIcon(int value)
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
||||||
|
saveFile["bird"]["icon"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetBirdIcon()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return;
|
||||||
|
if (saveFile["bird"]["icon"] == null) return;
|
||||||
|
(saveFile["bird"] as JObject)?.Remove("icon");
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetBirdIcon()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return 1;
|
||||||
|
if (saveFile["bird"]["icon"] == null) return 1;
|
||||||
|
return int.Parse(saveFile["bird"]["icon"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetBirdOverlay(int value)
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
||||||
|
saveFile["bird"]["overlay"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void UnsetBirdOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return;
|
||||||
|
if (saveFile["bird"]["overlay"] == null) return;
|
||||||
|
(saveFile["bird"] as JObject)?.Remove("overlay");
|
||||||
|
}
|
||||||
|
public int GetBirdOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return 0;
|
||||||
|
if (saveFile["bird"]["overlay"] == null) return 0;
|
||||||
|
return int.Parse(saveFile["bird"]["overlay"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetBirdPastOverlay(int value)
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) saveFile["bird"] = new JObject();
|
||||||
|
saveFile["bird"]["pastOverlay"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetBirdPastOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return;
|
||||||
|
if (saveFile["bird"]["pastOverlay"] == null) return;
|
||||||
|
(saveFile["bird"] as JObject)?.Remove("pastOverlay");
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetBirdPastOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["bird"] == null) return 0;
|
||||||
|
if (saveFile["bird"]["pastOverlay"] == null) return 0;
|
||||||
|
return int.Parse(saveFile["bird"]["pastOverlay"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
//Settings stuff
|
||||||
|
|
||||||
|
public void SetSettingFullScreen(bool value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["fullScreen"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool? GetSettingFullScreen()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return null;
|
||||||
|
if (saveFile["settings"]["fullScreen"] == null) return null;
|
||||||
|
return bool.Parse(saveFile["settings"]["fullScreen"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingShowFPS(bool value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["showFps"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GetSettingShowFPS()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return false;
|
||||||
|
if (saveFile["settings"]["showFps"] == null) return false;
|
||||||
|
return bool.Parse(saveFile["settings"]["showFps"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingVsync(bool value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["vsync"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool? GetSettingVsync()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return null;
|
||||||
|
if (saveFile["settings"]["vsync"] == null) return null;
|
||||||
|
return bool.Parse(saveFile["settings"]["vsync"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingHideSocials(bool value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["hideSocials"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool? GetSettingHideSocials()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return null;
|
||||||
|
if (saveFile["settings"]["hideSocials"] == null) return null;
|
||||||
|
return bool.Parse(saveFile["settings"]["hideSocials"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingMusicVolume(float value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["musicVolume"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetSettingMusicVolume()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return 1f;
|
||||||
|
if (saveFile["settings"]["musicVolume"] == null) return 1f;
|
||||||
|
return float.Parse(saveFile["settings"]["musicVolume"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetSettingSFXVolume(float value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
saveFile["settings"]["sfxVolume"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float GetSettingSFXVolume()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return 1f;
|
||||||
|
if (saveFile["settings"]["sfxVolume"] == null) return 1f;
|
||||||
|
return float.Parse(saveFile["settings"]["sfxVolume"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetColorSettingBackground(JArray value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
if (saveFile["settings"]["colors"] == null) saveFile["settings"]["colors"] = new JObject();
|
||||||
|
saveFile["settings"]["colors"]["background"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JArray GetColorSettingBackground()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return new JArray(58, 58, 58);
|
||||||
|
if (saveFile["settings"]["colors"] == null) return new JArray(58, 58, 58);
|
||||||
|
if (saveFile["settings"]["colors"]["background"] == null) return new JArray(58, 58, 58);
|
||||||
|
return JArray.Parse(saveFile["settings"]["colors"]["background"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetColorSettingIcon(JArray value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
if (saveFile["settings"]["colors"] == null) saveFile["settings"]["colors"] = new JObject();
|
||||||
|
saveFile["settings"]["colors"]["icon"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JArray GetColorSettingIcon()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return new JArray(255, 255, 255);
|
||||||
|
if (saveFile["settings"]["colors"] == null) return new JArray(255, 255, 255);
|
||||||
|
if (saveFile["settings"]["colors"]["icon"] == null) return new JArray(255, 255, 255);
|
||||||
|
return JArray.Parse(saveFile["settings"]["colors"]["icon"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetColorSettingIcon()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return;
|
||||||
|
if (saveFile["settings"]["colors"] == null) return;
|
||||||
|
if (saveFile["settings"]["colors"]["icon"] == null) return;
|
||||||
|
(saveFile["settings"]["colors"] as JObject)?.Remove("icon");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetColorSettingOverlay(JArray value)
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) saveFile["settings"] = new JObject();
|
||||||
|
if (saveFile["settings"]["colors"] == null) saveFile["settings"]["colors"] = new JObject();
|
||||||
|
saveFile["settings"]["colors"]["overlay"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public JArray GetColorSettingOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return new JArray(255, 255, 255);
|
||||||
|
if (saveFile["settings"]["colors"] == null) return new JArray(255, 255, 255);
|
||||||
|
if (saveFile["settings"]["colors"]["overlay"] == null) return new JArray(255, 255, 255);
|
||||||
|
return JArray.Parse(saveFile["settings"]["colors"]["overlay"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetColorSettingOverlay()
|
||||||
|
{
|
||||||
|
if (saveFile["settings"] == null) return;
|
||||||
|
if (saveFile["settings"]["colors"] == null) return;
|
||||||
|
if (saveFile["settings"]["colors"]["overlay"] == null) return;
|
||||||
|
(saveFile["settings"]["colors"] as JObject)?.Remove("overlay");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Account stuff
|
||||||
|
|
||||||
|
public void SetAccountSession(string value)
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) saveFile["account"] = new JObject();
|
||||||
|
saveFile["account"]["session"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetAccountSession()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return null;
|
||||||
|
if (saveFile["account"]["session"] == null) return null;
|
||||||
|
return saveFile["account"]["session"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetAccountSession()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return;
|
||||||
|
(saveFile["account"] as JObject)?.Remove("session");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAccountName(string value)
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) saveFile["account"] = new JObject();
|
||||||
|
saveFile["account"]["name"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetAccountName()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return null;
|
||||||
|
if (saveFile["account"]["name"] == null) return null;
|
||||||
|
return saveFile["account"]["name"].ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetAccountName()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return;
|
||||||
|
(saveFile["account"] as JObject)?.Remove("name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetAccountID(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) saveFile["account"] = new JObject();
|
||||||
|
saveFile["account"]["id"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger? GetAccountID()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return null;
|
||||||
|
if (saveFile["account"]["id"] == null) return null;
|
||||||
|
return BigInteger.Parse(saveFile["account"]["id"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetAccountID()
|
||||||
|
{
|
||||||
|
if (saveFile["account"] == null) return;
|
||||||
|
(saveFile["account"] as JObject)?.Remove("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Game store stuff
|
||||||
|
|
||||||
|
public void SetGameStoreHighScore(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["highScore"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreHighScore()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["highScore"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["highScore"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreHighScore()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("highScore");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalAttepts(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalAttempts"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalAttepts()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalAttempts"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalAttempts"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalAttepts()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalAttempts");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalNormalBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalNormalBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalNormalBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalNormalBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalNormalBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalNormalBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalNormalBerries");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalPoisonBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalPoisonBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalPoisonBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalPoisonBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalPoisonBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalPoisonBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalPoisonBerries");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalSlowBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalSlowBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalSlowBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalSlowBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalSlowBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalSlowBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalSlowBerries");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalUltraBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalUltraBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalUltraBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalUltraBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalUltraBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalUltraBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalUltraBerries");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGameStoreTotalSpeedyBerries(BigInteger value)
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||||
|
saveFile["gameStore"]["totalSpeedyBerries"] = value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigInteger GetGameStoreTotalSpeedyBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return 0;
|
||||||
|
if (saveFile["gameStore"]["totalSpeedyBerries"] == null) return 0;
|
||||||
|
return BigInteger.Parse(saveFile["gameStore"]["totalSpeedyBerries"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnsetGameStoreTotalSpeedyBerries()
|
||||||
|
{
|
||||||
|
if (saveFile["gameStore"] == null) return;
|
||||||
|
(saveFile["gameStore"] as JObject)?.Remove("totalSpeedyBerries");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
Assets/Scripts/BazookaSetting.cs
Normal file
7
Assets/Scripts/BazookaSetting.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
public enum BazookaSetting
|
||||||
|
{
|
||||||
|
FullScreen,
|
||||||
|
ShowFPS,
|
||||||
|
Vsync,
|
||||||
|
HideSocials
|
||||||
|
}
|
||||||
2
Assets/Scripts/BazookaSetting.cs.meta
Normal file
2
Assets/Scripts/BazookaSetting.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ee4201969db9e67d3b251fdcec5bfbd2
|
||||||
@@ -22,7 +22,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
if (!PlayerPrefs.HasKey("gameSession") || !PlayerPrefs.HasKey("userName") || !PlayerPrefs.HasKey("userId"))
|
if (BazookaManager.Instance.GetAccountID() == null || BazookaManager.Instance.GetAccountName() == null || BazookaManager.Instance.GetAccountSession() == null)
|
||||||
{
|
{
|
||||||
sendButton.interactable = false;
|
sendButton.interactable = false;
|
||||||
messageInputField.interactable = false;
|
messageInputField.interactable = false;
|
||||||
@@ -56,7 +56,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
|
|
||||||
EncryptedWWWForm dataForm = new();
|
EncryptedWWWForm dataForm = new();
|
||||||
dataForm.AddField("content", text);
|
dataForm.AddField("content", text);
|
||||||
dataForm.AddField("gameSession", PlayerPrefs.GetString("gameSession", ""));
|
dataForm.AddField("gameSession", BazookaManager.Instance.GetAccountSession());
|
||||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "sendChatroomMessage.php", dataForm.GetWWWForm());
|
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "sendChatroomMessage.php", dataForm.GetWWWForm());
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
@@ -179,7 +179,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
var overlayG = rowSplit[10];
|
var overlayG = rowSplit[10];
|
||||||
var overlayB = rowSplit[11];
|
var overlayB = rowSplit[11];
|
||||||
|
|
||||||
if (content.transform.Find("ChatroomRow_" + id) != null)
|
if (content.transform.Find("ChatroomRow_" + id + "_" + uid) != null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -229,7 +229,7 @@ public class ChatroomMenu : MonoBehaviour
|
|||||||
playerIcon.color = Color.white;
|
playerIcon.color = Color.white;
|
||||||
playerOverlayIcon.color = Color.white;
|
playerOverlayIcon.color = Color.white;
|
||||||
}
|
}
|
||||||
rowInfo.name = "ChatroomRow_" + id;
|
rowInfo.name = "ChatroomRow_" + id + "_" + uid;
|
||||||
rowInfo.SetActive(true);
|
rowInfo.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,27 +40,27 @@ public class GamePlayer : MonoBehaviour
|
|||||||
public GameObject backButton;
|
public GameObject backButton;
|
||||||
public float lastMoveTime;
|
public float lastMoveTime;
|
||||||
|
|
||||||
void Awake()
|
void Start()
|
||||||
{
|
{
|
||||||
var backgroundColor = PlayerPrefs.GetString("BackgroundColor", "58;58;58").Split(";");
|
var backgroundColor = BazookaManager.Instance.GetColorSettingBackground();
|
||||||
var birdColor = PlayerPrefs.GetString("BirdColor", "255;255;255").Split(";");
|
var birdColor = BazookaManager.Instance.GetColorSettingIcon();
|
||||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
var overlayColor = BazookaManager.Instance.GetColorSettingOverlay();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Camera.main.backgroundColor = new Color(
|
Camera.main.backgroundColor = new Color(
|
||||||
int.Parse(backgroundColor[0]) / 255f,
|
int.Parse(backgroundColor[0].ToString()) / 255f,
|
||||||
int.Parse(backgroundColor[1]) / 255f,
|
int.Parse(backgroundColor[1].ToString()) / 255f,
|
||||||
int.Parse(backgroundColor[2]) / 255f
|
int.Parse(backgroundColor[2].ToString()) / 255f
|
||||||
);
|
);
|
||||||
bird.GetComponent<SpriteRenderer>().color = new Color(
|
bird.GetComponent<SpriteRenderer>().color = new Color(
|
||||||
int.Parse(birdColor[0]) / 255f,
|
int.Parse(birdColor[0].ToString()) / 255f,
|
||||||
int.Parse(birdColor[1]) / 255f,
|
int.Parse(birdColor[1].ToString()) / 255f,
|
||||||
int.Parse(birdColor[2]) / 255f
|
int.Parse(birdColor[2].ToString()) / 255f
|
||||||
);
|
);
|
||||||
bird.transform.GetChild(0).GetComponent<SpriteRenderer>().color = new Color(
|
bird.transform.GetChild(0).GetComponent<SpriteRenderer>().color = new Color(
|
||||||
int.Parse(overlayColor[0]) / 255f,
|
int.Parse(overlayColor[0].ToString()) / 255f,
|
||||||
int.Parse(overlayColor[1]) / 255f,
|
int.Parse(overlayColor[1].ToString()) / 255f,
|
||||||
int.Parse(overlayColor[2]) / 255f
|
int.Parse(overlayColor[2].ToString()) / 255f
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -71,25 +71,22 @@ public class GamePlayer : MonoBehaviour
|
|||||||
lastMoveTime = Time.time;
|
lastMoveTime = Time.time;
|
||||||
UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable();
|
UnityEngine.InputSystem.EnhancedTouch.EnhancedTouchSupport.Enable();
|
||||||
instance = this;
|
instance = this;
|
||||||
highscore = BigInteger.Parse(PlayerPrefs.GetString("HighScoreV2", "0"));
|
highscore = BazookaManager.Instance.GetGameStoreHighScore();
|
||||||
totalNormalBerries = BigInteger.Parse(PlayerPrefs.GetString("TotalNormalBerries", "0"));
|
totalNormalBerries = BazookaManager.Instance.GetGameStoreTotalNormalBerries();
|
||||||
totalPoisonBerries = BigInteger.Parse(PlayerPrefs.GetString("TotalPoisonBerries", "0"));
|
totalPoisonBerries = BazookaManager.Instance.GetGameStoreTotalPoisonBerries();
|
||||||
totalSlowBerries = BigInteger.Parse(PlayerPrefs.GetString("TotalSlowBerries", "0"));
|
totalSlowBerries = BazookaManager.Instance.GetGameStoreTotalSlowBerries();
|
||||||
totalUltraBerries = BigInteger.Parse(PlayerPrefs.GetString("TotalUltraBerries", "0"));
|
totalUltraBerries = BazookaManager.Instance.GetGameStoreTotalUltraBerries();
|
||||||
totalSpeedyBerries = BigInteger.Parse(PlayerPrefs.GetString("TotalSpeedyBerries", "0"));
|
totalSpeedyBerries = BazookaManager.Instance.GetGameStoreTotalSpeedyBerries();
|
||||||
totalAttempts = BigInteger.Parse(PlayerPrefs.GetString("TotalAttempts", "0"));
|
totalAttempts = BazookaManager.Instance.GetGameStoreTotalAttepts();
|
||||||
}
|
|
||||||
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
Cursor.visible = false;
|
Cursor.visible = false;
|
||||||
Cursor.lockState = CursorLockMode.Locked;
|
Cursor.lockState = CursorLockMode.Locked;
|
||||||
SpriteRenderer component = bird.GetComponent<SpriteRenderer>();
|
SpriteRenderer component = bird.GetComponent<SpriteRenderer>();
|
||||||
int num = PlayerPrefs.GetInt("icon", 1);
|
int num = BazookaManager.Instance.GetBirdIcon();
|
||||||
int num2 = PlayerPrefs.GetInt("overlay", 0);
|
int num2 = BazookaManager.Instance.GetBirdOverlay();
|
||||||
if (num == 1)
|
if (num == 1)
|
||||||
{
|
{
|
||||||
component.sprite = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0));
|
component.sprite = Tools.GetIconForUser(BazookaManager.Instance.GetAccountID() ?? 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -118,15 +115,14 @@ public class GamePlayer : MonoBehaviour
|
|||||||
if (component.sprite == null)
|
if (component.sprite == null)
|
||||||
{
|
{
|
||||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_1");
|
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_1");
|
||||||
PlayerPrefs.SetInt("icon", 1);
|
BazookaManager.Instance.SetBirdIcon(1);
|
||||||
}
|
}
|
||||||
if (overlayRender.sprite == null && num2 != 0)
|
if (overlayRender.sprite == null && num2 != 0)
|
||||||
{
|
{
|
||||||
overlayRender.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_1");
|
overlayRender.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_1");
|
||||||
PlayerPrefs.SetInt("overlay", 1);
|
BazookaManager.Instance.SetBirdOverlay(1);
|
||||||
}
|
}
|
||||||
PlayerPrefs.Save();
|
backgroundMusic.volume = BazookaManager.Instance.GetSettingMusicVolume();
|
||||||
backgroundMusic.volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
|
||||||
screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;
|
screenWidth = Camera.main.orthographicSize * 2f * Camera.main.aspect;
|
||||||
if (Application.isMobilePlatform)
|
if (Application.isMobilePlatform)
|
||||||
{
|
{
|
||||||
@@ -264,7 +260,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
if (doJump && isGrounded)
|
if (doJump && isGrounded)
|
||||||
{
|
{
|
||||||
lastMoveTime = Time.time;
|
lastMoveTime = Time.time;
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Jump"), Camera.main.transform.position, 0.75f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Jump"), Camera.main.transform.position, 0.75f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
if (boostLeft > 0f || speedyLeft > 0f)
|
if (boostLeft > 0f || speedyLeft > 0f)
|
||||||
{
|
{
|
||||||
rb.linearVelocity = UnityEngine.Vector2.up * 12f;
|
rb.linearVelocity = UnityEngine.Vector2.up * 12f;
|
||||||
@@ -401,7 +397,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if (PlayerPrefs.GetInt("Setting2", 0) == 1 && Time.time > nextUpdate)
|
if (BazookaManager.Instance.GetSettingShowFPS() && Time.time > nextUpdate)
|
||||||
{
|
{
|
||||||
fps = 1f / Time.deltaTime;
|
fps = 1f / Time.deltaTime;
|
||||||
fpsCounter.text = "FPS: " + Mathf.Round(fps);
|
fpsCounter.text = "FPS: " + Mathf.Round(fps);
|
||||||
@@ -448,7 +444,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, berry.transform.position) < 1.5f)
|
else if (UnityEngine.Vector3.Distance(bird.transform.position, berry.transform.position) < 1.5f)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Eat"), Camera.main.transform.position, 1.2f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Eat"), Camera.main.transform.position, 1.2f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
Destroy(berry);
|
Destroy(berry);
|
||||||
totalNormalBerries++;
|
totalNormalBerries++;
|
||||||
UpdateStats(1, 0);
|
UpdateStats(1, 0);
|
||||||
@@ -471,7 +467,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject7.transform.position) < 1.5f)
|
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject7.transform.position) < 1.5f)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Death"), Camera.main.transform.position, 1.2f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Death"), Camera.main.transform.position, 1.2f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
Respawn();
|
Respawn();
|
||||||
totalPoisonBerries++;
|
totalPoisonBerries++;
|
||||||
UpdateStats(0, 0);
|
UpdateStats(0, 0);
|
||||||
@@ -494,7 +490,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject8.transform.position) < 1.5f)
|
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject8.transform.position) < 1.5f)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Powerup"), Camera.main.transform.position, 0.35f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Powerup"), Camera.main.transform.position, 0.35f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
Destroy(gameObject8);
|
Destroy(gameObject8);
|
||||||
totalUltraBerries++;
|
totalUltraBerries++;
|
||||||
speedyLeft = 0f;
|
speedyLeft = 0f;
|
||||||
@@ -527,7 +523,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject9.transform.position) < 1.5f)
|
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject9.transform.position) < 1.5f)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Downgrade"), Camera.main.transform.position, 0.35f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Downgrade"), Camera.main.transform.position, 0.35f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
Destroy(gameObject9);
|
Destroy(gameObject9);
|
||||||
boostLeft = 0f;
|
boostLeft = 0f;
|
||||||
slownessLeft = 10f;
|
slownessLeft = 10f;
|
||||||
@@ -556,7 +552,7 @@ public class GamePlayer : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject10.transform.position) < 1.5f)
|
else if (UnityEngine.Vector3.Distance(bird.transform.position, gameObject10.transform.position) < 1.5f)
|
||||||
{
|
{
|
||||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/SpeedyPowerup"), Camera.main.transform.position, 0.35f * PlayerPrefs.GetFloat("sfxVolume", 1f));
|
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/SpeedyPowerup"), Camera.main.transform.position, 0.35f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||||
Destroy(gameObject10);
|
Destroy(gameObject10);
|
||||||
boostLeft = 0f;
|
boostLeft = 0f;
|
||||||
slownessLeft = 0f;
|
slownessLeft = 0f;
|
||||||
@@ -658,14 +654,13 @@ public class GamePlayer : MonoBehaviour
|
|||||||
{
|
{
|
||||||
highscore = score;
|
highscore = score;
|
||||||
}
|
}
|
||||||
PlayerPrefs.SetString("HighScoreV2", highscore.ToString());
|
BazookaManager.Instance.SetGameStoreHighScore(highscore);
|
||||||
PlayerPrefs.SetString("TotalNormalBerries", totalNormalBerries.ToString());
|
BazookaManager.Instance.SetGameStoreTotalNormalBerries(totalNormalBerries);
|
||||||
PlayerPrefs.SetString("TotalPoisonBerries", totalPoisonBerries.ToString());
|
BazookaManager.Instance.SetGameStoreTotalPoisonBerries(totalPoisonBerries);
|
||||||
PlayerPrefs.SetString("TotalSlowBerries", totalSlowBerries.ToString());
|
BazookaManager.Instance.SetGameStoreTotalSlowBerries(totalSlowBerries);
|
||||||
PlayerPrefs.SetString("TotalUltraBerries", totalUltraBerries.ToString());
|
BazookaManager.Instance.SetGameStoreTotalUltraBerries(totalUltraBerries);
|
||||||
PlayerPrefs.SetString("TotalSpeedyBerries", totalSpeedyBerries.ToString());
|
BazookaManager.Instance.SetGameStoreTotalSpeedyBerries(totalSpeedyBerries);
|
||||||
PlayerPrefs.SetString("TotalAttempts", totalAttempts.ToString());
|
BazookaManager.Instance.SetGameStoreTotalAttepts(totalAttempts);
|
||||||
PlayerPrefs.Save();
|
|
||||||
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)}";
|
||||||
if (restartButton != null) restartButton.GetComponent<Renderer>().material.color = score == 0 ? Color.gray : Color.white;
|
if (restartButton != null) restartButton.GetComponent<Renderer>().material.color = score == 0 ? Color.gray : Color.white;
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ public class GamePlayerPauseMenu : MonoBehaviour
|
|||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
musicSlider.value = PlayerPrefs.GetFloat("musicVolume", 1f);
|
musicSlider.value = BazookaManager.Instance.GetSettingMusicVolume();
|
||||||
sfxSlider.value = PlayerPrefs.GetFloat("sfxVolume", 1f);
|
sfxSlider.value = BazookaManager.Instance.GetSettingSFXVolume();
|
||||||
backButton.onClick.AddListener(async () =>
|
backButton.onClick.AddListener(async () =>
|
||||||
{
|
{
|
||||||
await UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
|
await UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("MainMenu");
|
||||||
@@ -30,14 +30,12 @@ public class GamePlayerPauseMenu : MonoBehaviour
|
|||||||
continueButton.onClick.AddListener(GamePlayer.instance.DisablePause);
|
continueButton.onClick.AddListener(GamePlayer.instance.DisablePause);
|
||||||
musicSlider.onValueChanged.AddListener(value =>
|
musicSlider.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetFloat("musicVolume", value);
|
BazookaManager.Instance.SetSettingMusicVolume(value);
|
||||||
PlayerPrefs.Save();
|
|
||||||
songLoop.volume = value;
|
songLoop.volume = value;
|
||||||
});
|
});
|
||||||
sfxSlider.onValueChanged.AddListener(value =>
|
sfxSlider.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetFloat("sfxVolume", value);
|
BazookaManager.Instance.SetSettingSFXVolume(value);
|
||||||
PlayerPrefs.Save();
|
|
||||||
});
|
});
|
||||||
editUiButton.onClick.AddListener(() =>
|
editUiButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,22 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class HideIfSettingFalse : MonoBehaviour
|
public class HideIfSettingFalse : MonoBehaviour {
|
||||||
{
|
public BazookaSetting setting;
|
||||||
public string setting;
|
|
||||||
public bool reverse;
|
public bool reverse;
|
||||||
|
|
||||||
void Awake()
|
void Start() {
|
||||||
{
|
bool value = GetSettingValue(setting);
|
||||||
gameObject.SetActive(PlayerPrefs.GetInt(setting, 0) == (reverse ? 0 : 1));
|
gameObject.SetActive(value == !reverse);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool GetSettingValue(BazookaSetting s) {
|
||||||
|
var b = BazookaManager.Instance;
|
||||||
|
return s switch {
|
||||||
|
BazookaSetting.FullScreen => b.GetSettingFullScreen() ?? false,
|
||||||
|
BazookaSetting.ShowFPS => b.GetSettingShowFPS(),
|
||||||
|
BazookaSetting.Vsync => b.GetSettingVsync() ?? false,
|
||||||
|
BazookaSetting.HideSocials => b.GetSettingHideSocials() ?? false,
|
||||||
|
_ => false
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,12 +40,12 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
defaultIcon = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0));
|
defaultIcon = Tools.GetIconForUser(BazookaManager.Instance.GetAccountID() ?? 0);
|
||||||
icon1.transform.GetChild(0).GetComponent<Image>().sprite = defaultIcon;
|
icon1.transform.GetChild(0).GetComponent<Image>().sprite = defaultIcon;
|
||||||
SwitchToIcon();
|
SwitchToIcon();
|
||||||
SelectOverlay(PlayerPrefs.GetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 14)));
|
SelectOverlay(BazookaManager.Instance.GetBirdOverlay());
|
||||||
SelectIcon(PlayerPrefs.GetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8)));
|
SelectIcon(BazookaManager.Instance.GetBirdIcon());
|
||||||
if (PlayerPrefs.GetInt("icon", 0) == 7)
|
if (BazookaManager.Instance.GetBirdIcon() == 7)
|
||||||
{
|
{
|
||||||
SelectOverlay(0);
|
SelectOverlay(0);
|
||||||
placeholderButton.interactable = false;
|
placeholderButton.interactable = false;
|
||||||
@@ -53,9 +53,6 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
placeholderButton.onClick.AddListener(ToggleKit);
|
placeholderButton.onClick.AddListener(ToggleKit);
|
||||||
backButton.onClick.AddListener(async () =>
|
backButton.onClick.AddListener(async () =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8));
|
|
||||||
PlayerPrefs.SetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 14));
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
await SceneManager.LoadSceneAsync("MainMenu");
|
await SceneManager.LoadSceneAsync("MainMenu");
|
||||||
});
|
});
|
||||||
previewBird.GetComponentInParent<Button>().onClick.AddListener(() =>
|
previewBird.GetComponentInParent<Button>().onClick.AddListener(() =>
|
||||||
@@ -139,8 +136,7 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
|
|
||||||
private void SelectIcon(int iconID)
|
private void SelectIcon(int iconID)
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt("icon", iconID);
|
BazookaManager.Instance.SetBirdIcon(iconID);
|
||||||
PlayerPrefs.Save();
|
|
||||||
icon1.interactable = iconID != 1;
|
icon1.interactable = iconID != 1;
|
||||||
icon2.interactable = iconID != 2;
|
icon2.interactable = iconID != 2;
|
||||||
icon3.interactable = iconID != 3;
|
icon3.interactable = iconID != 3;
|
||||||
@@ -161,7 +157,7 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SelectOverlay(PlayerPrefs.GetInt("pastOverlay", 0), false);
|
SelectOverlay(BazookaManager.Instance.GetBirdPastOverlay(), false);
|
||||||
placeholderButton.interactable = true;
|
placeholderButton.interactable = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,10 +166,9 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (savePast)
|
if (savePast)
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt("pastOverlay", PlayerPrefs.GetInt("overlay", 0));
|
BazookaManager.Instance.SetBirdPastOverlay(BazookaManager.Instance.GetBirdOverlay());
|
||||||
}
|
}
|
||||||
PlayerPrefs.SetInt("overlay", overlayID);
|
BazookaManager.Instance.SetBirdOverlay(overlayID);
|
||||||
PlayerPrefs.Save();
|
|
||||||
overlay0.interactable = overlayID != 0;
|
overlay0.interactable = overlayID != 0;
|
||||||
overlay1.interactable = overlayID != 1;
|
overlay1.interactable = overlayID != 1;
|
||||||
overlay2.interactable = overlayID != 2;
|
overlay2.interactable = overlayID != 2;
|
||||||
@@ -182,7 +177,7 @@ public class Iconsmenu : MonoBehaviour
|
|||||||
overlay5.interactable = overlayID != 5;
|
overlay5.interactable = overlayID != 5;
|
||||||
overlay6.interactable = overlayID != 6;
|
overlay6.interactable = overlayID != 6;
|
||||||
overlay7.interactable = overlayID != 7;
|
overlay7.interactable = overlayID != 7;
|
||||||
overlay8.interactable = !(PlayerPrefs.GetInt("userId", 0) == 1 && PlayerPrefs.GetInt("icon", 0) == 1) && overlayID != 8;
|
overlay8.interactable = !(BazookaManager.Instance.GetAccountID() == 1 && BazookaManager.Instance.GetBirdIcon() == 1) && overlayID != 8;
|
||||||
overlay9.interactable = overlayID != 9;
|
overlay9.interactable = overlayID != 9;
|
||||||
overlay10.interactable = overlayID != 10;
|
overlay10.interactable = overlayID != 10;
|
||||||
overlay11.interactable = overlayID != 11;
|
overlay11.interactable = overlayID != 11;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@@ -7,56 +8,71 @@ public class IconsMenuBirdColorPanel : MonoBehaviour
|
|||||||
public Slider rSlider;
|
public Slider rSlider;
|
||||||
public Slider gSlider;
|
public Slider gSlider;
|
||||||
public Slider bSlider;
|
public Slider bSlider;
|
||||||
|
public ColorPickerUI colorPickerUI;
|
||||||
|
public GameObject manualModeUI;
|
||||||
public TMP_InputField hexValue;
|
public TMP_InputField hexValue;
|
||||||
public Image previewImage;
|
public Image previewImage;
|
||||||
public Button resetButton;
|
public Button resetButton;
|
||||||
|
public Button switchModeButton;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
var birdColor = PlayerPrefs.GetString("BirdColor", "255;255;255").Split(";");
|
var birdColor = BazookaManager.Instance.GetColorSettingIcon();
|
||||||
try
|
rSlider.value = (int)birdColor[0];
|
||||||
{
|
gSlider.value = (int)birdColor[1];
|
||||||
rSlider.value = int.Parse(birdColor[0]);
|
bSlider.value = (int)birdColor[2];
|
||||||
gSlider.value = int.Parse(birdColor[1]);
|
|
||||||
bSlider.value = int.Parse(birdColor[2]);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Debug.LogError("Invalid BirdColor format");
|
|
||||||
rSlider.value = 255; gSlider.value = 255; bSlider.value = 255;
|
|
||||||
}
|
|
||||||
SlidersChanged();
|
|
||||||
|
|
||||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
SyncAll();
|
||||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
|
||||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
rSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
gSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
bSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
|
||||||
hexValue.onValueChanged.AddListener(value =>
|
hexValue.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
var v = value.StartsWith("#") ? value[1..] : value;
|
var hex = value.StartsWith("#") ? value : "#" + value;
|
||||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
if (hex.Length == 7 && ColorUtility.TryParseHtmlString(hex, out var col))
|
||||||
{
|
{
|
||||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||||
previewImage.color = col;
|
SyncAll();
|
||||||
PlayerPrefs.SetString("BirdColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
resetButton.onClick.AddListener(() =>
|
resetButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
hexValue.text = "#FFFFFF";
|
rSlider.value = gSlider.value = bSlider.value = 255;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
switchModeButton.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
bool enableManual = !manualModeUI.activeSelf;
|
||||||
|
manualModeUI.SetActive(enableManual);
|
||||||
|
colorPickerUI.gameObject.SetActive(!enableManual);
|
||||||
|
});
|
||||||
|
|
||||||
|
colorPickerUI.OnColorChanged += color =>
|
||||||
|
{
|
||||||
|
rSlider.SetValueWithoutNotify(color.r * 255);
|
||||||
|
gSlider.SetValueWithoutNotify(color.g * 255);
|
||||||
|
bSlider.SetValueWithoutNotify(color.b * 255);
|
||||||
|
SyncAll(fromPicker: true);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void SlidersChanged()
|
void SyncAll(bool fromPicker = false)
|
||||||
{
|
{
|
||||||
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
||||||
|
|
||||||
|
if (!fromPicker) colorPickerUI.SetSelectedColor(rSlider.value, gSlider.value, bSlider.value);
|
||||||
|
|
||||||
previewImage.color = col;
|
previewImage.color = col;
|
||||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
hexValue.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGB(col));
|
||||||
PlayerPrefs.SetString("BirdColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
BazookaManager.Instance.SetColorSettingIcon(new JArray(
|
||||||
PlayerPrefs.Save();
|
(int)rSlider.value,
|
||||||
|
(int)gSlider.value,
|
||||||
|
(int)bSlider.value
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@@ -7,56 +8,71 @@ public class IconsMenuOverlayColorPanel : MonoBehaviour
|
|||||||
public Slider rSlider;
|
public Slider rSlider;
|
||||||
public Slider gSlider;
|
public Slider gSlider;
|
||||||
public Slider bSlider;
|
public Slider bSlider;
|
||||||
|
public ColorPickerUI colorPickerUI;
|
||||||
|
public GameObject manualModeUI;
|
||||||
public TMP_InputField hexValue;
|
public TMP_InputField hexValue;
|
||||||
public Image previewImage;
|
public Image previewImage;
|
||||||
public Button resetButton;
|
public Button resetButton;
|
||||||
|
public Button switchModeButton;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
var overlayColor = BazookaManager.Instance.GetColorSettingOverlay();
|
||||||
try
|
rSlider.value = (int)overlayColor[0];
|
||||||
{
|
gSlider.value = (int)overlayColor[1];
|
||||||
rSlider.value = int.Parse(overlayColor[0]);
|
bSlider.value = (int)overlayColor[2];
|
||||||
gSlider.value = int.Parse(overlayColor[1]);
|
|
||||||
bSlider.value = int.Parse(overlayColor[2]);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Debug.LogError("Invalid OverlayColor format");
|
|
||||||
rSlider.value = 255; gSlider.value = 255; bSlider.value = 255;
|
|
||||||
}
|
|
||||||
SlidersChanged();
|
|
||||||
|
|
||||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
SyncAll();
|
||||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
|
||||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
rSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
gSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
bSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
|
||||||
hexValue.onValueChanged.AddListener(value =>
|
hexValue.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
var v = value.StartsWith("#") ? value[1..] : value;
|
var hex = value.StartsWith("#") ? value : "#" + value;
|
||||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
if (hex.Length == 7 && ColorUtility.TryParseHtmlString(hex, out var col))
|
||||||
{
|
{
|
||||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||||
previewImage.color = col;
|
SyncAll();
|
||||||
PlayerPrefs.SetString("OverlayColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
resetButton.onClick.AddListener(() =>
|
resetButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
hexValue.text = "#FFFFFF";
|
rSlider.value = gSlider.value = bSlider.value = 255;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
switchModeButton.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
bool enableManual = !manualModeUI.activeSelf;
|
||||||
|
manualModeUI.SetActive(enableManual);
|
||||||
|
colorPickerUI.gameObject.SetActive(!enableManual);
|
||||||
|
});
|
||||||
|
|
||||||
|
colorPickerUI.OnColorChanged += color =>
|
||||||
|
{
|
||||||
|
rSlider.SetValueWithoutNotify(color.r * 255);
|
||||||
|
gSlider.SetValueWithoutNotify(color.g * 255);
|
||||||
|
bSlider.SetValueWithoutNotify(color.b * 255);
|
||||||
|
SyncAll(fromPicker: true);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void SlidersChanged()
|
void SyncAll(bool fromPicker = false)
|
||||||
{
|
{
|
||||||
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
||||||
|
|
||||||
|
if (!fromPicker) colorPickerUI.SetSelectedColor(rSlider.value, gSlider.value, bSlider.value);
|
||||||
|
|
||||||
previewImage.color = col;
|
previewImage.color = col;
|
||||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
hexValue.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGB(col));
|
||||||
PlayerPrefs.SetString("OverlayColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
BazookaManager.Instance.SetColorSettingOverlay(new JArray(
|
||||||
PlayerPrefs.Save();
|
(int)rSlider.value,
|
||||||
|
(int)gSlider.value,
|
||||||
|
(int)bSlider.value
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -78,7 +79,7 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
berryPanel.SetActive(false);
|
berryPanel.SetActive(false);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
refreshButton.transform.localPosition = new Vector2(-402.5f, -282.33f);
|
refreshButton.transform.localPosition = new UnityEngine.Vector2(-402.5f, -282.33f);
|
||||||
refreshButton.gameObject.SetActive(true);
|
refreshButton.gameObject.SetActive(true);
|
||||||
GetTopPlayersScore();
|
GetTopPlayersScore();
|
||||||
selectionPanel.SetActive(false);
|
selectionPanel.SetActive(false);
|
||||||
@@ -86,7 +87,7 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
berryPanel.SetActive(false);
|
berryPanel.SetActive(false);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
refreshButton.transform.localPosition = new Vector2(402.5f, 282.33f);
|
refreshButton.transform.localPosition = new UnityEngine.Vector2(402.5f, 282.33f);
|
||||||
refreshButton.gameObject.SetActive(true);
|
refreshButton.gameObject.SetActive(true);
|
||||||
berryShowTypeDropdown.value = 0;
|
berryShowTypeDropdown.value = 0;
|
||||||
GetTopPlayersBerry(0);
|
GetTopPlayersBerry(0);
|
||||||
@@ -165,6 +166,12 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
|
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
|
||||||
var highScoreText = entryInfo.transform.GetChild(1).GetComponent<TMP_Text>();
|
var highScoreText = entryInfo.transform.GetChild(1).GetComponent<TMP_Text>();
|
||||||
|
|
||||||
|
if (BazookaManager.Instance.GetAccountID() == BigInteger.Parse(uid))
|
||||||
|
{
|
||||||
|
usernameText.color = Color.aquamarine;
|
||||||
|
highScoreText.color = Color.aquamarine;
|
||||||
|
}
|
||||||
|
|
||||||
usernameText.text = $"{username} (#{i + 1})";
|
usernameText.text = $"{username} (#{i + 1})";
|
||||||
highScoreText.text += Tools.FormatWithCommas(highScore);
|
highScoreText.text += Tools.FormatWithCommas(highScore);
|
||||||
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
||||||
@@ -179,15 +186,15 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (overlay == "8")
|
else if (overlay == "8")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.56f, 14.81f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-16.56f, 14.81f);
|
||||||
}
|
}
|
||||||
else if (overlay == "11")
|
else if (overlay == "11")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-14.74451f, 20.39122f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-14.74451f, 20.39122f);
|
||||||
}
|
}
|
||||||
else if (overlay == "13")
|
else if (overlay == "13")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.54019f, 14.70365f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-16.54019f, 14.70365f);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -281,6 +288,12 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
|
var playerOverlayIcon = playerIcon.transform.GetChild(0).GetComponent<Image>();
|
||||||
var highScoreText = entryInfo.transform.GetChild(1).GetComponent<TMP_Text>();
|
var highScoreText = entryInfo.transform.GetChild(1).GetComponent<TMP_Text>();
|
||||||
|
|
||||||
|
if (BazookaManager.Instance.GetAccountID() == BigInteger.Parse(uid))
|
||||||
|
{
|
||||||
|
usernameText.color = Color.aquamarine;
|
||||||
|
highScoreText.color = Color.aquamarine;
|
||||||
|
}
|
||||||
|
|
||||||
usernameText.text = $"{username} (#{i + 1})";
|
usernameText.text = $"{username} (#{i + 1})";
|
||||||
highScoreText.text += Tools.FormatWithCommas(highScore);
|
highScoreText.text += Tools.FormatWithCommas(highScore);
|
||||||
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
||||||
@@ -295,15 +308,15 @@ public class LeaderboardsMenu : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else if (overlay == "8")
|
else if (overlay == "8")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.56f, 14.81f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-16.56f, 14.81f);
|
||||||
}
|
}
|
||||||
else if (overlay == "11")
|
else if (overlay == "11")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-14.74451f, 20.39122f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-14.74451f, 20.39122f);
|
||||||
}
|
}
|
||||||
else if (overlay == "13")
|
else if (overlay == "13")
|
||||||
{
|
{
|
||||||
playerOverlayIcon.transform.localPosition = new Vector2(-16.54019f, 14.70365f);
|
playerOverlayIcon.transform.localPosition = new UnityEngine.Vector2(-16.54019f, 14.70365f);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Networking;
|
using UnityEngine.Networking;
|
||||||
@@ -13,41 +12,6 @@ public class LoadingMenu : MonoBehaviour
|
|||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
if (PlayerPrefs.GetString("latestVersion", Application.version) == "1.4.0-beta1")
|
|
||||||
{
|
|
||||||
PlayerPrefs.DeleteKey("Setting2");
|
|
||||||
PlayerPrefs.DeleteKey("Setting3");
|
|
||||||
PlayerPrefs.SetInt("Setting2", PlayerPrefs.GetInt("Setting4", 0));
|
|
||||||
PlayerPrefs.SetInt("Setting3", PlayerPrefs.GetInt("Setting5", 0));
|
|
||||||
PlayerPrefs.SetString("latestVersion", "1.4.0");
|
|
||||||
}
|
|
||||||
if (PlayerPrefs.HasKey("HighScore"))
|
|
||||||
{
|
|
||||||
PlayerPrefs.SetString("HighScoreV2", Math.Max(PlayerPrefs.GetInt("HighScore"), 0).ToString());
|
|
||||||
PlayerPrefs.DeleteKey("HighScore");
|
|
||||||
}
|
|
||||||
QualitySettings.vSyncCount = PlayerPrefs.GetInt("Setting3", 1) == 1 ? 1 : -1;
|
|
||||||
if (!Application.isMobilePlatform && Application.platform != RuntimePlatform.WebGLPlayer)
|
|
||||||
{
|
|
||||||
SetIfNone("Setting1", 1);
|
|
||||||
SetIfNone("Setting2", 0);
|
|
||||||
SetIfNone("Setting3", 1);
|
|
||||||
SetIfNone("Setting4", 0);
|
|
||||||
Screen.fullScreen = PlayerPrefs.GetInt("Setting1", 1) == 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetIfNone("Setting1", 1, true);
|
|
||||||
SetIfNone("Setting2", 0);
|
|
||||||
SetIfNone("Setting3", 1, true);
|
|
||||||
SetIfNone("Setting4", 0);
|
|
||||||
Application.targetFrameRate = 360;
|
|
||||||
QualitySettings.vSyncCount = 0;
|
|
||||||
if (Application.platform == RuntimePlatform.WebGLPlayer)
|
|
||||||
{
|
|
||||||
Screen.fullScreen = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlayerPrefs.SetString("latestVersion", Application.version);
|
PlayerPrefs.SetString("latestVersion", Application.version);
|
||||||
updateButton.onClick.AddListener(() =>
|
updateButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
@@ -67,24 +31,17 @@ public class LoadingMenu : MonoBehaviour
|
|||||||
async void CheckUpdate()
|
async void CheckUpdate()
|
||||||
{
|
{
|
||||||
string response;
|
string response;
|
||||||
if (Application.platform != RuntimePlatform.WebGLPlayer)
|
using UnityWebRequest request = UnityWebRequest.Get(SensitiveInfo.SERVER_DATABASE_PREFIX + "canLoadClient.php");
|
||||||
|
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||||
|
request.SetRequestHeader("ClientVersion", Application.version);
|
||||||
|
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
|
||||||
|
await request.SendWebRequest();
|
||||||
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
{
|
{
|
||||||
using UnityWebRequest request = UnityWebRequest.Get(SensitiveInfo.SERVER_DATABASE_PREFIX + "canLoadClient.php");
|
text.text = "Failed to check version";
|
||||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
return;
|
||||||
request.SetRequestHeader("ClientVersion", Application.version);
|
|
||||||
request.SetRequestHeader("ClientPlatform", Application.platform.ToString());
|
|
||||||
await request.SendWebRequest();
|
|
||||||
if (request.result != UnityWebRequest.Result.Success)
|
|
||||||
{
|
|
||||||
text.text = "Failed to check version";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
response = request.downloadHandler.text;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
response = "1";
|
|
||||||
}
|
}
|
||||||
|
response = request.downloadHandler.text;
|
||||||
if (response == "1")
|
if (response == "1")
|
||||||
{
|
{
|
||||||
await SceneManager.LoadSceneAsync("MainMenu");
|
await SceneManager.LoadSceneAsync("MainMenu");
|
||||||
@@ -117,12 +74,4 @@ public class LoadingMenu : MonoBehaviour
|
|||||||
updateButton.gameObject.SetActive(true);
|
updateButton.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetIfNone(string key, int value, bool overrideValue = false)
|
|
||||||
{
|
|
||||||
if (!PlayerPrefs.HasKey(key) || overrideValue)
|
|
||||||
{
|
|
||||||
PlayerPrefs.SetInt(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ public class MenuMusic : MonoBehaviour
|
|||||||
Instance = this;
|
Instance = this;
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||||
GetComponent<AudioSource>().volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
GetComponent<AudioSource>().volume = BazookaManager.Instance.GetSettingMusicVolume();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,50 +12,38 @@ public class SettingsMenu : MonoBehaviour
|
|||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
musicSlider.value = PlayerPrefs.GetFloat("musicVolume", 1f);
|
musicSlider.value = BazookaManager.Instance.GetSettingMusicVolume();
|
||||||
sfxSlider.value = PlayerPrefs.GetFloat("sfxVolume", 1f);
|
sfxSlider.value = BazookaManager.Instance.GetSettingSFXVolume();
|
||||||
if (!Application.isMobilePlatform)
|
if (!Application.isMobilePlatform)
|
||||||
{
|
{
|
||||||
setting1toggle.isOn = PlayerPrefs.GetInt("Setting1", 1) == 1;
|
setting1toggle.isOn = BazookaManager.Instance.GetSettingFullScreen() ?? true == true;
|
||||||
setting2toggle.isOn = PlayerPrefs.GetInt("Setting2", 0) == 1;
|
setting2toggle.isOn = BazookaManager.Instance.GetSettingShowFPS() == true;
|
||||||
setting3toggle.isOn = PlayerPrefs.GetInt("Setting3", 1) == 1;
|
setting3toggle.isOn = BazookaManager.Instance.GetSettingVsync() ?? true == true;
|
||||||
setting4toggle.isOn = PlayerPrefs.GetInt("Setting4", 0) == 1;
|
setting4toggle.isOn = BazookaManager.Instance.GetSettingHideSocials() == true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setting1toggle.interactable = false;
|
setting1toggle.interactable = false;
|
||||||
setting2toggle.isOn = PlayerPrefs.GetInt("Setting2", 0) == 1;
|
setting2toggle.isOn = BazookaManager.Instance.GetSettingShowFPS() == true;
|
||||||
setting3toggle.interactable = false;
|
setting3toggle.interactable = false;
|
||||||
setting4toggle.isOn = PlayerPrefs.GetInt("Setting4", 0) == 1;
|
setting4toggle.isOn = BazookaManager.Instance.GetSettingHideSocials() == true;
|
||||||
}
|
}
|
||||||
setting1toggle.onValueChanged.AddListener(value =>
|
setting1toggle.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
|
BazookaManager.Instance.SetSettingFullScreen(value);
|
||||||
Screen.fullScreen = value;
|
Screen.fullScreen = value;
|
||||||
PlayerPrefs.SetInt("Setting1", value ? 1 : 0);
|
|
||||||
});
|
});
|
||||||
setting2toggle.onValueChanged.AddListener(value =>
|
setting2toggle.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt("Setting2", value ? 1 : 0);
|
BazookaManager.Instance.SetSettingShowFPS(value);
|
||||||
});
|
});
|
||||||
setting3toggle.onValueChanged.AddListener(value =>
|
setting3toggle.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt("Setting3", value ? 1 : 0);
|
BazookaManager.Instance.SetSettingVsync(value);
|
||||||
QualitySettings.vSyncCount = value ? 1 : -1;
|
QualitySettings.vSyncCount = value ? 1 : -1;
|
||||||
});
|
});
|
||||||
setting4toggle.onValueChanged.AddListener(value =>
|
setting4toggle.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingHideSocials(value));
|
||||||
{
|
musicSlider.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingMusicVolume(value));
|
||||||
PlayerPrefs.SetInt("Setting4", value ? 1 : 0);
|
sfxSlider.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingSFXVolume(value));
|
||||||
});
|
|
||||||
musicSlider.onValueChanged.AddListener(value =>
|
|
||||||
{
|
|
||||||
PlayerPrefs.SetFloat("musicVolume", value);
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
MenuMusic.Instance.GetComponent<AudioSource>().volume = value;
|
|
||||||
});
|
|
||||||
sfxSlider.onValueChanged.AddListener(value =>
|
|
||||||
{
|
|
||||||
PlayerPrefs.SetFloat("sfxVolume", value);
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
@@ -7,56 +8,79 @@ public class SettingsMenuBgColorPanel : MonoBehaviour
|
|||||||
public Slider rSlider;
|
public Slider rSlider;
|
||||||
public Slider gSlider;
|
public Slider gSlider;
|
||||||
public Slider bSlider;
|
public Slider bSlider;
|
||||||
|
public ColorPickerUI colorPickerUI;
|
||||||
|
public GameObject manualModeUI;
|
||||||
|
public GameObject settingsUI;
|
||||||
public TMP_InputField hexValue;
|
public TMP_InputField hexValue;
|
||||||
public Image previewImage;
|
|
||||||
public Button resetButton;
|
public Button resetButton;
|
||||||
|
public Button switchModeButton;
|
||||||
|
public Button previewButton;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
var backgroundColor = PlayerPrefs.GetString("BackgroundColor", "58;58;58").Split(";");
|
var backgroundColor = BazookaManager.Instance.GetColorSettingBackground();
|
||||||
try
|
rSlider.value = (int)backgroundColor[0];
|
||||||
{
|
gSlider.value = (int)backgroundColor[1];
|
||||||
rSlider.value = int.Parse(backgroundColor[0]);
|
bSlider.value = (int)backgroundColor[2];
|
||||||
gSlider.value = int.Parse(backgroundColor[1]);
|
|
||||||
bSlider.value = int.Parse(backgroundColor[2]);
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Debug.LogError("Invalid BackgroundColor format");
|
|
||||||
rSlider.value = 58; gSlider.value = 58; bSlider.value = 58;
|
|
||||||
}
|
|
||||||
SlidersChanged();
|
|
||||||
|
|
||||||
rSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
SyncAll();
|
||||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
|
||||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
rSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
gSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
bSlider.onValueChanged.AddListener(_ => SyncAll());
|
||||||
|
|
||||||
hexValue.onValueChanged.AddListener(value =>
|
hexValue.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
var v = value.StartsWith("#") ? value[1..] : value;
|
var hex = value.StartsWith("#") ? value : "#" + value;
|
||||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
if (hex.Length == 7 && ColorUtility.TryParseHtmlString(hex, out var col))
|
||||||
{
|
{
|
||||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||||
previewImage.color = col;
|
SyncAll();
|
||||||
PlayerPrefs.SetString("BackgroundColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
|
||||||
PlayerPrefs.Save();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
resetButton.onClick.AddListener(() =>
|
resetButton.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
hexValue.text = "#3A3A3A";
|
rSlider.value = gSlider.value = bSlider.value = 58;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
switchModeButton.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
bool enableManual = !manualModeUI.activeSelf;
|
||||||
|
manualModeUI.SetActive(enableManual);
|
||||||
|
colorPickerUI.gameObject.SetActive(!enableManual);
|
||||||
|
});
|
||||||
|
|
||||||
|
previewButton.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
|
settingsUI.SetActive(!settingsUI.activeSelf);
|
||||||
|
Camera.main.backgroundColor = !settingsUI.activeSelf ? new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f) : new Color(24 / 255f, 24 / 255f, 24 / 255f);
|
||||||
|
previewButton.transform.GetChild(0).GetComponent<TMP_Text>().text = settingsUI.activeSelf ? "Preview On" : "Preview Off";
|
||||||
|
});
|
||||||
|
|
||||||
|
colorPickerUI.OnColorChanged += color =>
|
||||||
|
{
|
||||||
|
rSlider.SetValueWithoutNotify(color.r * 255);
|
||||||
|
gSlider.SetValueWithoutNotify(color.g * 255);
|
||||||
|
bSlider.SetValueWithoutNotify(color.b * 255);
|
||||||
|
SyncAll(fromPicker: true);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void SlidersChanged()
|
void SyncAll(bool fromPicker = false)
|
||||||
{
|
{
|
||||||
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
var col = new Color(rSlider.value / 255f, gSlider.value / 255f, bSlider.value / 255f);
|
||||||
previewImage.color = col;
|
|
||||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
if (!fromPicker) colorPickerUI.SetSelectedColor(rSlider.value, gSlider.value, bSlider.value);
|
||||||
PlayerPrefs.SetString("BackgroundColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
if (!settingsUI.activeSelf) Camera.main.backgroundColor = col;
|
||||||
PlayerPrefs.Save();
|
|
||||||
|
hexValue.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGB(col));
|
||||||
|
BazookaManager.Instance.SetColorSettingBackground(new JArray(
|
||||||
|
(int)rSlider.value,
|
||||||
|
(int)gSlider.value,
|
||||||
|
(int)bSlider.value
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public static class Tools
|
public static class Tools
|
||||||
{
|
{
|
||||||
public static Sprite GetIconForUser(int user)
|
public static Sprite GetIconForUser(BigInteger user)
|
||||||
{
|
{
|
||||||
if (user == 1)
|
if (user == 1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user