Пример #1
0
 public void Update()
 {
     if (UpdateAction != null)
     {
         UpdateAction.Invoke();
     }
 }
Пример #2
0
        public override void Update()
        {
            float fadeintime = MaxTime * FADETIME;

            Color = Color.Lerp(_startColor, _endColor, TimeActive / (float)MaxTime);
            if (TimeActive < fadeintime)
            {
                Color *= (TimeActive / fadeintime);
            }
            else if (TimeActive > (MaxTime - fadeintime))
            {
                Color *= ((MaxTime - TimeActive) / fadeintime);
            }

            Lighting.AddLight(Position, Color.ToVector3() * Scale * 0.5f);

            if (_action != null)
            {
                _action.Invoke(this);
            }

            if (TimeActive > MaxTime)
            {
                Kill();
            }
        }
Пример #3
0
 /// <summary>
 /// Called by Framweork internally. Not to be called actively.
 /// </summary>
 private void Update()
 {
     if (ActiveByHierarchy)
     {
         UpdateAction?.Invoke();
     }
 }
Пример #4
0
        private void EditBtn_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var btn  = (Border)sender;
            var data = (PersonEvents)btn.Tag;

            UpdateAction?.Invoke(data);
        }
Пример #5
0
 void IUpdateSelectedHandler.OnUpdateSelected(BaseEventData eventData)
 {
     if (field.text == CurrentText)
     {
         return;
     }
     CurrentText = field.text;
     UpdateAction?.Invoke();
 }
Пример #6
0
        public virtual void PerformUpdate(GameTime time)
        {
            if (Disabled)
            {
                return;
            }

            UpdateAction?.Invoke(time, this);

            foreach (UIElement child in Children)
            {
                Task.Run(() =>
                {
                    child.PerformUpdate(time);
                });
            }
        }
Пример #7
0
        public override void Update()
        {
            Velocity *= 0.98f;
            float halftime = (MaxTime / 2f);

            opacity   = (float)Math.Pow((halftime - Math.Abs(halftime - TimeActive)) / halftime, 0.75);
            Scale    += 0.01f;
            Rotation += Velocity.X * 0.1f;

            if (_action != null)
            {
                _action.Invoke(this);
            }

            if (TimeActive >= MaxTime)
            {
                Kill();
            }
        }
Пример #8
0
        public override void Update()
        {
            if (!_parent.active || _parent.type != ModContent.NPCType <MeteorMagus_NPC>())
            {
                Kill();
                return;
            }

            _offset   += Velocity;
            Position   = _parent.Center + _offset;
            _rotation += _rotationVelocity;

            if (_action != null)
            {
                _action.Invoke(this);
            }

            int fadeOutStartTime = (_maxTime - _fadeTime);

            //Fade in after spawning
            if (TimeActive < _fadeTime)
            {
                _opacity = TimeActive / (float)_fadeTime;
            }

            //Fade out before dying
            else if (TimeActive > fadeOutStartTime)
            {
                _opacity = 1 - (TimeActive - fadeOutStartTime) / (float)_fadeTime;
            }

            //Otherwise full opacity
            else
            {
                _opacity = 1;
            }

            if (TimeActive > _maxTime)
            {
                Kill();
            }
        }
Пример #9
0
 private void FixedUpdate()
 {
     _onFixedUpdate?.Invoke(Time.fixedDeltaTime);
 }
Пример #10
0
 private void LateUpdate()
 {
     _onLateUpdate?.Invoke(Time.deltaTime);
 }
Пример #11
0
 private void Update()
 {
     _onUpdate?.Invoke(Time.deltaTime);
 }
Пример #12
0
 private void Update()
 {
     UpdateAction?.Invoke(Time.deltaTime, Time.unscaledDeltaTime);
 }
Пример #13
0
 private void Update()
 {
     UpdateAction?.Invoke();
 }
Пример #14
0
 public void Update(float dt)
 {
     UpdateAction?.Invoke(dt);
 }
Пример #15
0
 public void Update()
 {
     UpdateAction?.Invoke();
 }
Пример #16
0
 private void btnUpdate_Click(object sender, EventArgs e)
 {
     UpdateAction?.Invoke();
 }