Files
Simulation/Assets/Scripts/SimulationModel.cs

32 lines
577 B
C#
Raw Normal View History

using UnityEngine;
public class SimulationModel : MonoBehaviour
{
private bool isQuitting = false;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnEnable()
{
DataManager.I.AddModel(this);
}
private void OnDisable()
{
if (isQuitting) return;
DataManager.I.RemoveModel(this);
}
void OnApplicationQuit()
{
isQuitting = true;
}
}