Ejemplo n.º 1
0
        protected override void OnDestroy()
        {
            if (!Container.IsDisposing && !Container.IsDisposed)
            {
                Container.Dispose();
            }

            Instance = null;
            base.OnDestroy();
        }
Ejemplo n.º 2
0
        protected override void Awake()
        {
            base.Awake();
            DontDestroyOnLoad(gameObject);
            if (Instance != null)
            {
                throw new InvalidOperationException($"There is already an instance of '{nameof(UnityApp)}'.");
            }

            Instance  = this;
            Container = new Container();
            Container.BindInstance <ITickService>(gameObject.AddComponent <TickService>());
        }