iso2/effects/BloodPool.cs

A short blood pool effect. On start it swaps the renderer to a plane with the blood decal material, places it slightly above the ground, scales it to zero and tags it as a dynamic iso entity. After a 1.5 second delay it grows the scale toward 0.5 over a couple of seconds.

public class BloodPool : Component {
	[Property, RequireComponent] public ModelRenderer Renderer {get; set;}
	private TimeUntil Wait;

	protected override void OnStart() {
		Renderer.Model = Model.Plane;
		Renderer.MaterialOverride = Material.Load("materials/decal/blood.vmat");
		WorldScale = 0f;
		WorldPosition += Vector3.Up * 0.3f;
		Tags.Add("dynamic");
		Tags.Add("entity");
		Tags.Add("isoentity");
		Wait = 1.5f;
		base.OnStart();
	}

	protected override void OnUpdate() {
		if (Wait)
			WorldScale = WorldScale.x.Approach(0.5f, Time.Delta * 0.3f);
		base.OnUpdate();
	}
}