public override void Update(GameTime gameTime) { if (_done) { return; } base.Update(gameTime); if (_timer > _duration) { return; } _scale = _scale0 + _scaleVelocity * _dt; Pax4Sprite sprite = null; foreach (KeyValuePair <String, PaxState> kvp in GetChild()) { if (kvp.Value is Pax4Sprite) { sprite = (Pax4Sprite)kvp.Value; sprite.SetScale(_scale); } } if (_done) { if (!_continuous) { _scale = _scale1; if (_oscillating) { Ini(_scale1, _scale0, _duration); Trigger(); } } else { _done = false; } } }
public override bool Trigger() { if (GetChild() != null && base.Trigger()) { Pax4Sprite sprite = null; foreach (KeyValuePair <String, PaxState> kvp in GetChild()) { if (kvp.Value is Pax4Sprite) { sprite = (Pax4Sprite)kvp.Value; sprite.SetScale(_scale0); } } return(true); } return(false); }