Forgot to make this render the icon lmao
This commit is contained in:
@@ -984,6 +984,8 @@ MonoBehaviour:
|
||||
randomBerryStat: {fileID: 1090220579}
|
||||
antiBerryStat: {fileID: 1053747956}
|
||||
coinStat: {fileID: 585371381}
|
||||
playerIcon: {fileID: 721797927}
|
||||
playerOverlay: {fileID: 1494895754}
|
||||
xpUsernameText: {fileID: 878626768}
|
||||
xpText: {fileID: 1130693395}
|
||||
xpLevelText: {fileID: 834723901}
|
||||
@@ -1459,7 +1461,8 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: -1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 1494895753}
|
||||
m_Father: {fileID: 2134090716}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
@@ -1487,7 +1490,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: dbf71fe5f2caad1409da64bdbb781eb5, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: 517f61beffc1245a0a3f7907c7c93eb0, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -4001,6 +4004,81 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1383712832}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1494895752
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1494895753}
|
||||
- component: {fileID: 1494895755}
|
||||
- component: {fileID: 1494895754}
|
||||
m_Layer: 5
|
||||
m_Name: Overlay
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &1494895753
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1494895752}
|
||||
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: 721797926}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -25, y: 34.6}
|
||||
m_SizeDelta: {x: 31, y: 13}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1494895754
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1494895752}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &1494895755
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1494895752}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &1520056479
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@@ -3,6 +3,7 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StatsMenu : MonoBehaviour
|
||||
{
|
||||
@@ -18,6 +19,9 @@ public class StatsMenu : MonoBehaviour
|
||||
[SerializeField] private TMP_Text antiBerryStat;
|
||||
[SerializeField] private TMP_Text coinStat;
|
||||
|
||||
[SerializeField] private Image playerIcon;
|
||||
[SerializeField] private Image playerOverlay;
|
||||
|
||||
[SerializeField] private TMP_Text xpUsernameText;
|
||||
[SerializeField] private TMP_Text xpText;
|
||||
[SerializeField] private TMP_Text xpLevelText;
|
||||
@@ -36,6 +40,46 @@ public class StatsMenu : MonoBehaviour
|
||||
antiBerryStat.text = BazookaManager.Instance.GetGameStoreTotalAntiBerries().ToString();
|
||||
coinStat.text = BazookaManager.Instance.GetCustomBirdIconData().Balance.ToString();
|
||||
|
||||
var customIcon = BazookaManager.Instance.GetCustomBirdIconData().Selected;
|
||||
if (customIcon == null)
|
||||
{
|
||||
int icon = BazookaManager.Instance.GetBirdIcon();
|
||||
int overlay = BazookaManager.Instance.GetBirdOverlay();
|
||||
var iconColor = BazookaManager.Instance.GetColorSettingIcon();
|
||||
var overlayColor = BazookaManager.Instance.GetColorSettingOverlay();
|
||||
playerIcon.sprite = Resources.Load<Sprite>("Icons/Icons/bird_" + icon);
|
||||
if (icon == 1) playerIcon.sprite = Tools.GetIconForUser(BazookaManager.Instance.GetAccountID() ?? 0);
|
||||
playerOverlay.sprite = Resources.Load<Sprite>("Icons/Overlays/overlay_" + overlay);
|
||||
if (overlay != 0) playerOverlay.gameObject.SetActive(true);
|
||||
if (overlay == 8) playerOverlay.rectTransform.localPosition = new Vector3(-27.6232f, 23.42824f, 0f);
|
||||
else if (overlay == 11) playerOverlay.rectTransform.localPosition = new Vector3(-24.5611f, 32.250931f, 0f);
|
||||
else if (overlay == 13) playerOverlay.rectTransform.localPosition = new Vector3(-27.56624f, 23.25544f, 0f);
|
||||
try
|
||||
{
|
||||
playerIcon.color = new Color(
|
||||
int.Parse(iconColor[0].ToString()) / 255f,
|
||||
int.Parse(iconColor[1].ToString()) / 255f,
|
||||
int.Parse(iconColor[2].ToString()) / 255f
|
||||
);
|
||||
playerOverlay.color = new Color(
|
||||
int.Parse(overlayColor[0].ToString()) / 255f,
|
||||
int.Parse(overlayColor[1].ToString()) / 255f,
|
||||
int.Parse(overlayColor[2].ToString()) / 255f
|
||||
);
|
||||
}
|
||||
catch
|
||||
{
|
||||
playerIcon.color = Color.white;
|
||||
playerOverlay.color = Color.white;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var waitingForCustomIcon = playerIcon.gameObject.AddComponent<WaitingForCustomIcon>();
|
||||
waitingForCustomIcon.ID = customIcon;
|
||||
CustomIconLoader.Init(new[] { waitingForCustomIcon });
|
||||
}
|
||||
|
||||
var (_, level, currentXpInLevel, totalXpForLevel, percentDone) = Tools.GetLevelInfo();
|
||||
xpUsernameText.text = BazookaManager.Instance.GetAccountName() ?? "";
|
||||
xpText.text = currentXpInLevel.ToString() + "/" + totalXpForLevel.ToString() + " xp";
|
||||
|
||||
Reference in New Issue
Block a user