public void Reset(AntEmitter aEmitter) { _curColor = Preset.colour.startColor; _endColor = Preset.colour.endColor; _gradient = Preset.colour.gradient; _curve = Preset.colour.curveColor; _useChild = Preset.colour.useChildSprite; _gradientColor = Preset.colour.gradientColor; IsActive = (Preset.colour.animateColor || Preset.colour.gradientColor); if (Preset.colour.effectLifeTime) { _delta = _particle.Effect.Duration / _particle.Effect.TotalDuration; _delta = AntMath.TrimToRange(_delta, 0.0f, 1.0f); _curColor.r = AntMath.Lerp(_curColor.r, _endColor.r, _curve.Evaluate(_delta)); _curColor.g = AntMath.Lerp(_curColor.g, _endColor.g, _curve.Evaluate(_delta)); _curColor.b = AntMath.Lerp(_curColor.b, _endColor.b, _curve.Evaluate(_delta)); _curColor.a = AntMath.Lerp(_curColor.a, _endColor.a, _curve.Evaluate(_delta)); } if (_useChild) { _childSprite.color = _curColor; } else { _sprite.color = _curColor; } }
public void Reset(AntEmitter aEmitter) { IsActive = Preset.scale.animateScale; _endScale = Preset.scale.endScale; _startScale = Vector2.zero; _startScale.x = Preset.scale.startScale.x + AntMath.RandomRangeFloat(Preset.scale.rndToScaleX); _startScale.y = Preset.scale.startScale.y + AntMath.RandomRangeFloat(Preset.scale.rndToScaleY); _curveX = Preset.scale.scaleCurveX; _curveY = Preset.scale.scaleCurveY; _useChild = Preset.scale.useChildSprite; _proportional = Preset.scale.proportional; if (Preset.scale.effectLifeTime && !AntMath.Equal(_particle.Effect.lifeTime, 0.0f)) { _delta = _particle.Effect.Duration / _particle.Effect.TotalDuration; _delta = AntMath.TrimToRange(_delta, 0.0f, 1.0f); _startScale.x = AntMath.Lerp(_startScale.x, Preset.scale.endScale.x, _curveX.Evaluate(_delta)); _startScale.y = AntMath.Lerp(_startScale.y, Preset.scale.endScale.y, _curveY.Evaluate(_delta)); } if (Preset.scale.useChildSprite) { _childTransform.localScale = new Vector3( _startScale.x, (Preset.scale.proportional) ? _startScale.x : _startScale.y, 1.0f ); } else { _transform.localScale = new Vector3( _startScale.x, (Preset.scale.proportional) ? _startScale.x : _startScale.y, 1.0f ); } }