29 lines
435 B
C#
29 lines
435 B
C#
using UnityEngine;
|
|
|
|
public class DLCLocationLock : MonoBehaviour
|
|
{
|
|
public int mapID;
|
|
|
|
public GameObject locationButton;
|
|
|
|
private void Start()
|
|
{
|
|
Refresh();
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
DLCManager.OnUpdateDLCContents += Refresh;
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
DLCManager.OnUpdateDLCContents -= Refresh;
|
|
}
|
|
|
|
private void Refresh()
|
|
{
|
|
locationButton.SetActive(DLCManager.Instance.IsLevelUnlocked(mapID, out var _));
|
|
}
|
|
}
|