示例#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();
            }
        }
        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();
 }