bad-piggies-0.1.3-porting/Assets/Scripts/Assembly-CSharp/SandboxLevelButton.cs

35 lines
966 B
C#
Raw Normal View History

2024-02-24 22:40:44 -05:00
using UnityEngine;
public class SandboxLevelButton : MonoBehaviour
{
public int m_sandboxIndex;
[SerializeField]
private SandboxSelector m_sandboxSelector;
[SerializeField]
private TextMesh m_starsText;
private void Start()
{
bool @bool = GameProgress.GetBool("UnlockAllLevels");
m_starsText.text = GameProgress.SandboxStarCount(m_sandboxSelector.Levels[m_sandboxIndex]) + "/20";
if (GameProgress.GetBool(m_sandboxSelector.Levels[m_sandboxIndex] + "_sandbox_unlocked") || @bool || BuildCustomizationLoader.Instance.IsDebugBuild)
{
Button component = GetComponent<Button>();
component.MessageTargetObject = m_sandboxSelector.gameObject;
component.MethodToInvoke = "LoadSandboxLevel";
component.MessageParameter = m_sandboxIndex.ToString();
base.transform.FindChild("Lock").gameObject.active = false;
}
else
{
base.transform.FindChild("StarSet").gameObject.SetActiveRecursively(false);
}
}
private void Update()
{
}
}