Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/RefreshMenuObject.cs
2026-02-21 16:45:37 +08:00

140 lines
2.9 KiB
C#

using UnityEngine;
public class RefreshMenuObject : MonoBehaviour
{
public bool refreshOnAwake;
public bool refreshOnEnable;
public bool showInMenu = true;
public bool showInGame = true;
public bool showInFull = true;
public bool showInDemo = true;
public bool showOnlyInBeta;
public bool showOnlyCheats;
public bool showOnlyMyCheats;
public bool showInCasual = true;
public bool showInSimulator = true;
public bool showInEditorGame = true;
public bool showInOceanLevel = true;
public bool showInSteam = true;
public bool showInWeGame = true;
public bool showInGOG = true;
public bool showInOculus = true;
public bool showInViveport = true;
public bool showInMagenta = true;
public bool showInArcade = true;
public bool showInNonArcade = true;
public bool showInVR = true;
public bool showInNonVR = true;
private void Start()
{
if (refreshOnAwake)
{
Refresh();
}
}
private void OnEnable()
{
if (refreshOnEnable)
{
Refresh();
}
}
public void Refresh()
{
if (VRManager.IsVROn() && !showInVR)
{
base.gameObject.SetActive(false);
return;
}
if (!VRManager.IsVROn() && !showInNonVR)
{
base.gameObject.SetActive(false);
return;
}
if ((bool)GameController.Instance)
{
base.gameObject.SetActive(showInGame);
}
else
{
base.gameObject.SetActive(showInMenu);
}
if ((bool)GlobalSettings.Instance)
{
if (GlobalSettings.Instance.isDemo && !showInDemo)
{
base.gameObject.SetActive(false);
}
if (!GlobalSettings.Instance.isDemo && !showInFull)
{
base.gameObject.SetActive(false);
}
if (!GlobalSettings.Instance.isBeta && !GlobalSettings.Instance.turnOnMyCheats && showOnlyInBeta)
{
base.gameObject.SetActive(false);
}
if (showOnlyCheats && !showOnlyMyCheats && !GlobalSettings.Instance.turnOnCheats)
{
base.gameObject.SetActive(false);
}
if (showOnlyMyCheats && !GlobalSettings.Instance.turnOnMyCheats)
{
base.gameObject.SetActive(false);
}
if (GlobalSettings.Instance.playerSettings.IsCasual() && !showInCasual)
{
base.gameObject.SetActive(false);
}
if (!GlobalSettings.Instance.playerSettings.IsCasual() && !showInSimulator)
{
base.gameObject.SetActive(false);
}
if ((bool)GameController.Instance && (bool)GameController.Instance.fisheryEditorGame && !showInEditorGame)
{
base.gameObject.SetActive(false);
}
if ((bool)GameController.Instance && GameController.Instance.oceanLevel && !showInOceanLevel)
{
base.gameObject.SetActive(false);
}
if (GlobalSettings.Instance.currentPlatform == GlobalSettings.Platform.ARCADE && !showInArcade)
{
base.gameObject.SetActive(false);
}
if (GlobalSettings.Instance.currentPlatform != GlobalSettings.Platform.ARCADE && !showInNonArcade)
{
base.gameObject.SetActive(false);
}
}
if (!showInSteam)
{
base.gameObject.SetActive(false);
}
}
}