| | |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | |
| | | public class LogicEngine : MonoBehaviour |
| | | public class LogicEngine : SingletonMonobehaviour<LogicEngine> |
| | | { |
| | | public static LogicEngine Instance { get; private set; } |
| | | |
| | | [RuntimeInitializeOnLoadMethod] |
| | | static void Init() |
| | | { |
| | | if (FindObjectOfType<LogicEngine>() == null) |
| | | { |
| | | var gameObject = new GameObject("LogicEngine"); |
| | | Instance = gameObject.AddMissingComponent<LogicEngine>(); |
| | | GameObject.DontDestroyOnLoad(gameObject); |
| | | } |
| | | } |
| | | |
| | | List<LogicUpdate> logicUpdates = new List<LogicUpdate>(); |
| | | public void Register(LogicUpdate logicUpdate) |
| | | { |