Custom Modifier
Include your own custom modifiers, simple use the template below to start creating your own awesome modifier. This modifier will then automatically be included in the Curves Component.
using UnityEngine;
using UnityEngine.Splines;
using Abthoclo.Tools.Curves;
// Calling Haptic with a specific lowFrequence, highFrequence and duration.
[System.Serializable]
public class CustomModifier : CurvesModifier
{
[SerializeField]
private CustomData _customData;
public CustomModifier() { }
// Init
public CustomModifier(SplineContainer splineContainer)
{
_splineContainer = splineContainer;
_customData = new SplineExtrudeInfo();
_mesh = new Mesh();
}
// This contains your own custom implementation of your modifier
internal override Mesh CalculateMesh(out Matrix4x4 mat)
{
if (_mesh == null) _mesh = new Mesh();
mat = Matrix4x4.identity;
if (_splineContainer == null) return _mesh;
// ADD your own mesh modifier code here...
return _mesh;
}
// Array should contain all the Serialized Object you want to draw in the inspector
public override string[] GetRelativePropertyPaths() => new string[] { "_customData" };
// Name of your modifier
public override string ToString() => "Custom Modifier";
}