Esempio n. 1
0
 internal void Update(GameTime gameTime)
 {
     if (_slideState == SlideState.TransitionOn)
     {
         _pos += (_transitionDir * 20);
         if (_pos == 0)
         {
             _slideState = SlideState.Active;
         }
         OnActivate?.Invoke(this, null);
     }
     else if (_slideState == SlideState.TransitionOff)
     {
         _pos += (_transitionDir * 20);
         if (Math.Abs(_pos) == BOUNDARY)
         {
             _slideState = SlideState.Inactive;
         }
         OnDeactivate?.Invoke(this, null);
     }
     else if (_slideState == SlideState.Active)
     {
         foreach (var r in _renderers)
         {
             r.Update(gameTime);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Deactivates the Quantum Console.
        /// </summary>
        public void Deactivate()
        {
            IsActive = false;
            _containerRect.gameObject.SetActive(false);

            OnDeactivate?.Invoke();
        }
 public void Deactivate()
 {
     timer.Tick -= Timer_Tick;
     timer.Stop();
     lbltimer.Stop();
     OnDeactivate?.Invoke(this, new EventArgs());
     _IsActive = false;
 }
Esempio n. 4
0
    public void DeactivateTutorial()
    {
        TutorialObject _oldObject = _activeTutorial;

        _activeTutorial = null;

        OnDeactivate?.Invoke(_oldObject);
    }
Esempio n. 5
0
 public void Deactivate()
 {
     _active = false;
     if (OnDeactivate != null)
     {
         OnDeactivate.Invoke(this);
     }
 }
Esempio n. 6
0
    protected void Exit(ColliderType collider)
    {
        bool wasActive = Active;

        inside.Remove(collider);

        OnExit.Invoke(collider);

        if (wasActive && !Active)
        {
            OnDeactivate.Invoke(collider);
        }
    }
        private void DoDeactivate()
        {
            if (IsEnabled)
            {
                try
                {
                    OnDeactivate?.Invoke(this, EventArgs.Empty);

                    IsEnabled = true;
                }
                catch (Exception ex)
                {
                    Logger.Error("Failed to deactivate component.", ex);
                }
            }
        }
Esempio n. 8
0
        public async Task <string> Work(int fuelTankVolume, WriterDelegate writerDelegate)
        {
            try
            {
                int time = 3000;
                var step = time * Volume / 1000;
                for (int i = 0; i < fuelTankVolume; i += step)
                {
                    if (i == step)
                    {
                        OnActive?.Invoke(this, new EventArgs());
                    }
                    await Task.Delay(time);

                    writerDelegate($"{this.ToString()} Мощность = {Power} лс");
                }
                OnDeactivate?.Invoke(this, new EventArgs());
                return("ok");
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
 public void Deactivate()
 {
     OnDeactivate?.Invoke();
 }
 protected void Deactivate()
 {
     Active = false;
     OnDeactivate?.Invoke(this);
 }
Esempio n. 11
0
 private void Deactivate()
 {
     OnDeactivate?.Invoke(this);
 }
Esempio n. 12
0
 public void DestroyBullet()
 {
     GameManager.Instance.LevelController.Bullets.Remove(this);
     OnDeactivate?.Invoke(this);
 }
Esempio n. 13
0
 protected void OnDeactivated(object sender, EventArgs e)
 {
     OnDeactivate?.Invoke(sender, e);
     _IsActive = false;
 }