Tweaks and uncommitted stuff
I forgor
This commit is contained in:
@@ -37,22 +37,7 @@ public class GamePlayer : MonoBehaviour
|
||||
int num2 = PlayerPrefs.GetInt("overlay", 0);
|
||||
if (num == 1)
|
||||
{
|
||||
if (PlayerPrefs.GetInt("userID", 0) == 1)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-1");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 2)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-2");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 4)
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-3");
|
||||
}
|
||||
else
|
||||
{
|
||||
component.sprite = Resources.Load<Sprite>("Icons/Icons/bird_1");
|
||||
}
|
||||
component.sprite = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Text;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -35,6 +36,8 @@ public class Iconsmenu : MonoBehaviour
|
||||
|
||||
private void Start()
|
||||
{
|
||||
defaultIcon = Tools.GetIconForUser(PlayerPrefs.GetInt("userId", 0));
|
||||
icon1.transform.GetChild(0).GetComponent<Image>().sprite = defaultIcon;
|
||||
SwitchToIcon();
|
||||
SelectOverlay(PlayerPrefs.GetInt("overlay", Mathf.Clamp(PlayerPrefs.GetInt("overlay", 0), 0, 9)));
|
||||
SelectIcon(PlayerPrefs.GetInt("icon", Mathf.Clamp(PlayerPrefs.GetInt("icon", 0), 1, 8)));
|
||||
@@ -43,18 +46,6 @@ public class Iconsmenu : MonoBehaviour
|
||||
SelectOverlay(0);
|
||||
placeholderButton.interactable = false;
|
||||
}
|
||||
if (PlayerPrefs.GetInt("userID", 0) == 1)
|
||||
{
|
||||
defaultIcon = Resources.Load<Sprite>("Icons/Icons/bird_-1");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 2)
|
||||
{
|
||||
defaultIcon = Resources.Load<Sprite>("Icons/Icons/bird_-2");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 4)
|
||||
{
|
||||
defaultIcon = Resources.Load<Sprite>("Icons/Icons/bird_-3");
|
||||
}
|
||||
placeholderButton.onClick.AddListener(ToggleKit);
|
||||
backButton.onClick.AddListener(() =>
|
||||
{
|
||||
@@ -164,18 +155,7 @@ public class Iconsmenu : MonoBehaviour
|
||||
previewBird.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + iconID);
|
||||
if (iconID == 1)
|
||||
{
|
||||
if (PlayerPrefs.GetInt("userID", 0) == 1)
|
||||
{
|
||||
previewBird.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-1");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 2)
|
||||
{
|
||||
previewBird.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-2");
|
||||
}
|
||||
else if (PlayerPrefs.GetInt("userID", 0) == 4)
|
||||
{
|
||||
previewBird.sprite = Resources.Load<Sprite>("Icons/Icons/bird_-3");
|
||||
}
|
||||
previewBird.sprite = defaultIcon;
|
||||
}
|
||||
if (iconID == 7)
|
||||
{
|
||||
@@ -205,7 +185,7 @@ public class Iconsmenu : MonoBehaviour
|
||||
overlay5.interactable = (overlayID != 5);
|
||||
overlay6.interactable = (overlayID != 6);
|
||||
overlay7.interactable = (overlayID != 7);
|
||||
overlay8.interactable = (overlayID != 8);
|
||||
overlay8.interactable = (!(PlayerPrefs.GetInt("userId", 0) == 1 && PlayerPrefs.GetInt("icon", 0) == 1) && overlayID != 8);
|
||||
overlay9.interactable = (overlayID != 9);
|
||||
previewOverlay.rectTransform.localPosition = new Vector3(-32f, 44.66f, 0f);
|
||||
previewOverlay.gameObject.SetActive(true);
|
||||
|
||||
23
Assets/Scripts/Tools.cs
Normal file
23
Assets/Scripts/Tools.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
public static class Tools
|
||||
{
|
||||
public static Sprite GetIconForUser(int user)
|
||||
{
|
||||
if (user == 1)
|
||||
{
|
||||
return Resources.Load<Sprite>("Icons/Icons/bird_-1");
|
||||
}
|
||||
else if (user == 2)
|
||||
{
|
||||
return Resources.Load<Sprite>("Icons/Icons/bird_-2");
|
||||
}
|
||||
else if (user == 4)
|
||||
{
|
||||
return Resources.Load<Sprite>("Icons/Icons/bird_-3");
|
||||
} else
|
||||
{
|
||||
return Resources.Load<Sprite>("Icons/Icons/bird_1");
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Tools.cs.meta
Normal file
2
Assets/Scripts/Tools.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: deda68a80e559ac449fed42451588143
|
||||
10
Assets/Scripts/VersionText.cs
Normal file
10
Assets/Scripts/VersionText.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class VersionText : MonoBehaviour
|
||||
{
|
||||
void Awake()
|
||||
{
|
||||
gameObject.GetComponent<TMP_Text>().text = "v" + Application.version;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/VersionText.cs.meta
Normal file
2
Assets/Scripts/VersionText.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 613488aac53690d45b649b002c6180b2
|
||||
Reference in New Issue
Block a user