Example #1
0
        /// <summary>
        ///     Invalidates the background with its manny design
        /// </summary>
        public void InvalidateBackground()
        {
            var now = DateTime.Now.Hour;

            if (_current != null)
            {
                _current.Background.SetActive(false);
                _current.Manny.SetActive(false);
            }
            _current = Manny.HasDied()
                ? BackgroundDead
                : Backgrounds.FirstOrDefault(x => x.Time.Min <= now && x.Time.Max >= now);
            _current = _current ?? Backgrounds[0];
            _current.Background.SetActive(true);
            _current.Manny.SetActive(true);
            if (_dashboardAnimationHandler == null)
            {
                return;
            }
            _dashboardAnimationHandler.SetAnimator(_current.Manny);
        }