SbTween/Examples/SbeFloatTest.cs

A small example Component that, on start, tweens a float value between 0.18 and 0.46 repeatedly and assigns it to a HighlightOutline's Width property. It uses the SbTween extension to create a looping YoYo linear tween.

using Sandbox;
using SbTween;


namespace SbTween.Examples;

public sealed class SbeFloatTest : Component
{
	[Property] public HighlightOutline HO;

	protected override void OnStart()
	{
		this.GameObject.TweenFloat( 0.18f, 0.46f, 0.5f, ( val ) => HO.Width = val ).SetEase(EaseType.Linear).SetLoops(-1, LoopType.YoYo);
	}
}