Files
QuestAppLauncher/Assets/Scripts/GlobalState.cs
tverona1 dd7b8ff6a4 Added support for downloading assets (including auto-update)
- Added support for downloading assets (including auto-update)
- By default, auto-update is turned off. Enable it in settings.
- Default repository for app icons and names is [https://github.com/tverona1/QuestAppLauncher_assets]. This can be configured in config.json.
2019-08-17 17:13:07 -07:00

35 lines
854 B
C#

using UnityEngine;
using System.Collections;
namespace QuestAppLauncher
{
/// <summary>
/// Simple class that holds state that survives scene reloads.
/// Follows Unity's DontDestroyOnLoad singleton pattern.
/// </summary>
public class GlobalState : MonoBehaviour
{
public static GlobalState Instance;
// State to indicate whether we already checked for update
public bool CheckedForUpdate = false;
void Awake()
{
this.InstantiateController();
}
private void InstantiateController()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(this);
}
else if (this != Instance)
{
Destroy(this.gameObject);
}
}
}
}