Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
73822ebb94
|
|||
|
7b7890aa8c
|
|||
|
24f983ecb1
|
|||
|
d3ae8e56a5
|
|||
|
a968d6c28b
|
|||
|
a5d37fdaf5
|
|||
|
c13dd8439d
|
|||
|
b657415e9a
|
|||
|
7ef6d153e1
|
|||
|
06e367966a
|
BIN
Assets/Resources/Sounds/MenuMusic.mp3
Normal file
BIN
Assets/Resources/Sounds/MenuMusic.mp3
Normal file
Binary file not shown.
23
Assets/Resources/Sounds/MenuMusic.mp3.meta
Normal file
23
Assets/Resources/Sounds/MenuMusic.mp3.meta
Normal file
@@ -0,0 +1,23 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5f59ed3599d5096e2a37719634154c5a
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 8
|
||||
defaultSettings:
|
||||
serializedVersion: 2
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
preloadAudioData: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -6287,6 +6287,7 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
loggedInText: {fileID: 1811333580}
|
||||
accountLoggedOut: {fileID: 983419245}
|
||||
loggedInChangeUsernameButton: {fileID: 1572018539}
|
||||
loggedInChangePasswordButton: {fileID: 501899887}
|
||||
loggedInSaveButton: {fileID: 1394498766}
|
||||
@@ -6590,6 +6591,7 @@ MonoBehaviour:
|
||||
loggedOutLoginButton: {fileID: 1842378620}
|
||||
loggedOutRegisterButton: {fileID: 1888048651}
|
||||
loggedOutBackButton: {fileID: 1848992338}
|
||||
clearValues: 0
|
||||
--- !u!1 &989136372
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4191,6 +4191,148 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
sceneName: IconsMenu
|
||||
--- !u!1 &2001843690
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2001843693}
|
||||
- component: {fileID: 2001843692}
|
||||
- component: {fileID: 2001843691}
|
||||
m_Layer: 0
|
||||
m_Name: MenuMusic
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &2001843691
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 8febb42bbb9b4988498aad078a2a35a0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!82 &2001843692
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 5f59ed3599d5096e2a37719634154c5a, type: 3}
|
||||
m_Resource: {fileID: 8300000, guid: 5f59ed3599d5096e2a37719634154c5a, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 0
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 500
|
||||
Pan2D: 0
|
||||
rolloffMode: 0
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
- serializedVersion: 3
|
||||
time: 1
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!4 &2001843693
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2001843690}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &2038556859
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -4333,5 +4475,6 @@ SceneRoots:
|
||||
- {fileID: 519420032}
|
||||
- {fileID: 101625093}
|
||||
- {fileID: 583716567}
|
||||
- {fileID: 2001843693}
|
||||
- {fileID: 1263503583}
|
||||
- {fileID: 1513462405}
|
||||
|
||||
@@ -7,6 +7,7 @@ using UnityEngine.UI;
|
||||
public class AccountLoggedIn : MonoBehaviour
|
||||
{
|
||||
public TMP_Text loggedInText;
|
||||
public AccountLoggedOut accountLoggedOut;
|
||||
public Button loggedInChangeUsernameButton;
|
||||
public Button loggedInChangePasswordButton;
|
||||
public Button loggedInSaveButton;
|
||||
@@ -22,7 +23,10 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
loggedInSaveButton.onClick.AddListener(() => SaveAccount());
|
||||
loggedInLoadButton.onClick.AddListener(() => LoadAccount());
|
||||
loggedInRefreshLoginButton.onClick.AddListener(() => AccountHandler.instance.SwitchPanel(6));
|
||||
loggedInLogoutButton.onClick.AddListener(() => AccountHandler.instance.SwitchPanel(1));
|
||||
loggedInLogoutButton.onClick.AddListener(() => {
|
||||
accountLoggedOut.clearValues = true;
|
||||
AccountHandler.instance.SwitchPanel(1);
|
||||
});
|
||||
loggedInBackButton.onClick.AddListener(async () => await SceneManager.LoadSceneAsync("MainMenu"));
|
||||
}
|
||||
|
||||
@@ -52,6 +56,9 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
dataForm.AddField("birdR", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[0]);
|
||||
dataForm.AddField("birdG", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[1]);
|
||||
dataForm.AddField("birdB", PlayerPrefs.GetString("BirdColor", "255;255;255").Split(';')[2]);
|
||||
dataForm.AddField("overlayR", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[0]);
|
||||
dataForm.AddField("overlayG", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[1]);
|
||||
dataForm.AddField("overlayB", PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(';')[2]);
|
||||
using UnityWebRequest request = UnityWebRequest.Post(SensitiveInfo.SERVER_DATABASE_PREFIX + "saveAccount.php", dataForm.GetWWWForm());
|
||||
request.SetRequestHeader("Requester", "BerryDashClient");
|
||||
request.SetRequestHeader("ClientVersion", Application.version);
|
||||
@@ -134,6 +141,7 @@ public class AccountLoggedIn : MonoBehaviour
|
||||
PlayerPrefs.SetString("TotalSpeedyBerries", split[8]);
|
||||
PlayerPrefs.SetString("TotalAttempts", split[9]);
|
||||
PlayerPrefs.SetString("BirdColor", $"{split[10]};{split[11]};{split[12]}");
|
||||
PlayerPrefs.SetString("OverlayColor", $"{split[13]};{split[14]};{split[15]}");
|
||||
AccountHandler.UpdateStatusText(loggedInText, "Loaded account data", Color.green);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,6 +7,7 @@ public class AccountLoggedOut : MonoBehaviour
|
||||
public Button loggedOutLoginButton;
|
||||
public Button loggedOutRegisterButton;
|
||||
public Button loggedOutBackButton;
|
||||
public bool clearValues = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@@ -17,11 +18,23 @@ public class AccountLoggedOut : MonoBehaviour
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
PlayerPrefs.DeleteKey("gameSession");
|
||||
PlayerPrefs.DeleteKey("userName");
|
||||
PlayerPrefs.DeleteKey("userId");
|
||||
PlayerPrefs.SetString("HighScoreV2", "0");
|
||||
PlayerPrefs.SetInt("icon", 1);
|
||||
PlayerPrefs.SetInt("overlay", 0);
|
||||
if (clearValues)
|
||||
{
|
||||
PlayerPrefs.DeleteKey("gameSession");
|
||||
PlayerPrefs.DeleteKey("userName");
|
||||
PlayerPrefs.DeleteKey("userId");
|
||||
PlayerPrefs.SetString("HighScoreV2", "0");
|
||||
PlayerPrefs.SetInt("icon", 1);
|
||||
PlayerPrefs.SetInt("overlay", 0);
|
||||
PlayerPrefs.DeleteKey("TotalNormalBerries");
|
||||
PlayerPrefs.DeleteKey("TotalPoisonBerries");
|
||||
PlayerPrefs.DeleteKey("TotalSlowBerries");
|
||||
PlayerPrefs.DeleteKey("TotalUltraBerries");
|
||||
PlayerPrefs.DeleteKey("TotalSpeedyBerries");
|
||||
PlayerPrefs.DeleteKey("TotalAttempts");
|
||||
PlayerPrefs.DeleteKey("BirdColor");
|
||||
PlayerPrefs.DeleteKey("OverlayColor");
|
||||
clearValues = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,7 @@ public class AccountLogin : MonoBehaviour
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,12 @@ public class ChatroomMenu : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (!PlayerPrefs.HasKey("gameSession") || !PlayerPrefs.HasKey("userName") || !PlayerPrefs.HasKey("userId"))
|
||||
{
|
||||
sendButton.interactable = false;
|
||||
messageInputField.interactable = false;
|
||||
ShowStatus("Warning: You are not logged in. Please log in to send messages.");
|
||||
}
|
||||
backButton.onClick.AddListener(async () => await SceneManager.LoadSceneAsync("MainMenu"));
|
||||
sendButton.onClick.AddListener(async () => await HandleMessageSubmit());
|
||||
messageInputField.textComponent.textWrappingMode = TextWrappingModes.Normal;
|
||||
@@ -38,6 +44,7 @@ public class ChatroomMenu : MonoBehaviour
|
||||
|
||||
async Task HandleMessageSubmit()
|
||||
{
|
||||
if (!sendButton.interactable) return;
|
||||
var text = messageInputField.text.Clone() as string;
|
||||
messageInputField.text = string.Empty;
|
||||
if (string.IsNullOrEmpty(text))
|
||||
@@ -70,7 +77,7 @@ public class ChatroomMenu : MonoBehaviour
|
||||
ShowStatus("Encryption/decryption issues");
|
||||
break;
|
||||
case "-1":
|
||||
ShowStatus("Authentication error.");
|
||||
ShowStatus("Authentication error");
|
||||
break;
|
||||
case "1":
|
||||
StopCoroutine(refreshLoopRoutine);
|
||||
@@ -143,9 +150,6 @@ public class ChatroomMenu : MonoBehaviour
|
||||
case "-997":
|
||||
ShowStatus("Encryption/decryption issues");
|
||||
break;
|
||||
case "-1":
|
||||
ShowStatus("Authentication error.");
|
||||
break;
|
||||
default:
|
||||
var split = response.Split(':');
|
||||
if (split[0] == "1")
|
||||
@@ -163,6 +167,9 @@ public class ChatroomMenu : MonoBehaviour
|
||||
var birdR = rowSplit[6];
|
||||
var birdG = rowSplit[7];
|
||||
var birdB = rowSplit[8];
|
||||
var overlayR = rowSplit[9];
|
||||
var overlayG = rowSplit[10];
|
||||
var overlayB = rowSplit[11];
|
||||
|
||||
if (content.transform.Find("ChatroomRow_" + id) != null)
|
||||
{
|
||||
@@ -207,9 +214,11 @@ public class ChatroomMenu : MonoBehaviour
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
rowInfo.name = "ChatroomRow_" + id;
|
||||
rowInfo.SetActive(true);
|
||||
|
||||
@@ -6,7 +6,7 @@ public class EncryptedWWWForm
|
||||
|
||||
public void AddField(string key, string value)
|
||||
{
|
||||
form.AddField(key, SensitiveInfo.Encrypt(value, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
form.AddField(SensitiveInfo.Encrypt(key, SensitiveInfo.SERVER_SEND_TRANSFER_KEY), SensitiveInfo.Encrypt(value, SensitiveInfo.SERVER_SEND_TRANSFER_KEY));
|
||||
}
|
||||
|
||||
public WWWForm GetWWWForm() => form;
|
||||
|
||||
@@ -44,6 +44,7 @@ public class GamePlayer : MonoBehaviour
|
||||
{
|
||||
var backgroundColor = PlayerPrefs.GetString("BackgroundColor", "58;58;58").Split(";");
|
||||
var birdColor = PlayerPrefs.GetString("BirdColor", "255;255;255").Split(";");
|
||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
||||
try
|
||||
{
|
||||
Camera.main.backgroundColor = new Color(
|
||||
@@ -56,6 +57,11 @@ public class GamePlayer : MonoBehaviour
|
||||
int.Parse(birdColor[1])/255f,
|
||||
int.Parse(birdColor[2])/255f
|
||||
);
|
||||
bird.transform.GetChild(0).GetComponent<SpriteRenderer>().color = new Color(
|
||||
int.Parse(overlayColor[0])/255f,
|
||||
int.Parse(overlayColor[1])/255f,
|
||||
int.Parse(overlayColor[2])/255f
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
62
Assets/Scripts/IconsMenuOverlayColorPanel.cs
Normal file
62
Assets/Scripts/IconsMenuOverlayColorPanel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class IconsMenuOverlayColorPanel : MonoBehaviour
|
||||
{
|
||||
public Slider rSlider;
|
||||
public Slider gSlider;
|
||||
public Slider bSlider;
|
||||
public TMP_InputField hexValue;
|
||||
public Image previewImage;
|
||||
public Button resetButton;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
var overlayColor = PlayerPrefs.GetString("OverlayColor", "255;255;255").Split(";");
|
||||
try
|
||||
{
|
||||
rSlider.value = int.Parse(overlayColor[0]);
|
||||
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());
|
||||
gSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
bSlider.onValueChanged.AddListener(_ => SlidersChanged());
|
||||
|
||||
hexValue.onValueChanged.AddListener(value =>
|
||||
{
|
||||
var v = value.StartsWith("#") ? value[1..] : value;
|
||||
if (v.Length == 6 && ColorUtility.TryParseHtmlString("#" + v, out var col))
|
||||
{
|
||||
rSlider.SetValueWithoutNotify(col.r * 255f);
|
||||
gSlider.SetValueWithoutNotify(col.g * 255f);
|
||||
bSlider.SetValueWithoutNotify(col.b * 255f);
|
||||
previewImage.color = col;
|
||||
PlayerPrefs.SetString("OverlayColor", $"{(int)(col.r * 255)};{(int)(col.g * 255)};{(int)(col.b * 255)}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
});
|
||||
|
||||
resetButton.onClick.AddListener(() =>
|
||||
{
|
||||
hexValue.text = "#FFFFFF";
|
||||
});
|
||||
}
|
||||
|
||||
void SlidersChanged()
|
||||
{
|
||||
var col = new Color(rSlider.value/255f, gSlider.value/255f, bSlider.value/255f);
|
||||
previewImage.color = col;
|
||||
hexValue.SetTextWithoutNotify($"#{ColorUtility.ToHtmlStringRGB(col)}");
|
||||
PlayerPrefs.SetString("OverlayColor", $"{(int)rSlider.value};{(int)gSlider.value};{(int)bSlider.value}");
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/IconsMenuOverlayColorPanel.cs.meta
Normal file
2
Assets/Scripts/IconsMenuOverlayColorPanel.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65f6bd5c95bc89f17b1446eb992dc697
|
||||
@@ -144,6 +144,9 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
var birdR = split[5];
|
||||
var birdG = split[6];
|
||||
var birdB = split[7];
|
||||
var overlayR = split[8];
|
||||
var overlayG = split[9];
|
||||
var overlayB = split[10];
|
||||
|
||||
var entryInfo = Instantiate(scoreSampleObject, scoreContent.transform);
|
||||
var usernameText = entryInfo.transform.GetChild(0).GetComponent<TMP_Text>();
|
||||
@@ -178,9 +181,11 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
entryInfo.SetActive(true);
|
||||
}
|
||||
@@ -250,6 +255,9 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
var birdR = split[5];
|
||||
var birdG = split[6];
|
||||
var birdB = split[7];
|
||||
var overlayR = split[8];
|
||||
var overlayG = split[9];
|
||||
var overlayB = split[10];
|
||||
|
||||
var entryInfo = Instantiate(berrySampleObject, berryContent.transform);
|
||||
var usernameText = entryInfo.transform.GetChild(0).GetComponent<TMP_Text>();
|
||||
@@ -284,9 +292,11 @@ public class LeaderboardsMenu : MonoBehaviour
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color32(byte.Parse(birdR), byte.Parse(birdG), byte.Parse(birdB), 255);
|
||||
playerOverlayIcon.color = new Color32(byte.Parse(overlayR), byte.Parse(overlayG), byte.Parse(overlayB), 255);
|
||||
} catch (Exception)
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlayIcon.color = Color.white;
|
||||
}
|
||||
entryInfo.SetActive(true);
|
||||
}
|
||||
|
||||
@@ -89,6 +89,17 @@ public class LoadingMenu : MonoBehaviour
|
||||
await SceneManager.LoadSceneAsync("MainMenu");
|
||||
}
|
||||
else if (response == "2")
|
||||
{
|
||||
text.text = "Outdated client! You can still play the game and access the servers, but it isn't recommended.";
|
||||
|
||||
var updateButtonPos = updateButton.transform.localPosition;
|
||||
updateButtonPos.x = -135;
|
||||
updateButton.transform.localPosition = updateButtonPos;
|
||||
|
||||
updateButton.gameObject.SetActive(true);
|
||||
continueButton.gameObject.SetActive(true);
|
||||
}
|
||||
else if (response == "3")
|
||||
{
|
||||
text.text = "Outdated client! You can still load into the game, but online features may not be available.";
|
||||
|
||||
|
||||
31
Assets/Scripts/MenuMusic.cs
Normal file
31
Assets/Scripts/MenuMusic.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MenuMusic : MonoBehaviour
|
||||
{
|
||||
public static MenuMusic Instance;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
GetComponent<AudioSource>().volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
{
|
||||
if (scene.name == "GamePlayer")
|
||||
{
|
||||
SceneManager.sceneLoaded -= OnSceneLoaded;
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/MenuMusic.cs.meta
Normal file
2
Assets/Scripts/MenuMusic.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8febb42bbb9b4988498aad078a2a35a0
|
||||
@@ -54,6 +54,7 @@ public class SettingsMenu : MonoBehaviour
|
||||
{
|
||||
PlayerPrefs.SetFloat("musicVolume", value);
|
||||
PlayerPrefs.Save();
|
||||
MenuMusic.Instance.GetComponent<AudioSource>().volume = value;
|
||||
});
|
||||
sfxSlider.onValueChanged.AddListener(value =>
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@ PlayerSettings:
|
||||
loadStoreDebugModeEnabled: 0
|
||||
visionOSBundleVersion: 1.0
|
||||
tvOSBundleVersion: 1.0
|
||||
bundleVersion: 1.5.1
|
||||
bundleVersion: 1.5.2
|
||||
preloadedAssets:
|
||||
- {fileID: -944628639613478452, guid: 2bcd2660ca9b64942af0de543d8d7100, type: 3}
|
||||
metroInputSource: 0
|
||||
|
||||
Reference in New Issue
Block a user