You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.8 KiB
53 lines
1.8 KiB
using UnityEngine;
|
|
|
|
namespace UnityEditor.VFX.Operator
|
|
{
|
|
//[VFXHelpURL("Operator-SequentialCircle")]
|
|
[VFXInfo(category = "Math")]
|
|
class SequentialCircle : VFXOperator
|
|
{
|
|
public class InputProperties
|
|
{
|
|
[Tooltip("Element index used to loop over the sequence")]
|
|
public uint Index = 0u;
|
|
[Tooltip("Element count used to loop over the sequence")]
|
|
public uint Count = 64u;
|
|
[Tooltip("Center of the circle")]
|
|
public Position Center = Position.defaultValue;
|
|
[Tooltip("Rotation Axis")]
|
|
public DirectionType Normal = new DirectionType() { direction = Vector3.forward };
|
|
[Tooltip("Start Angle (Midnight direction)")]
|
|
public DirectionType Up = new DirectionType() { direction = Vector3.up };
|
|
[Tooltip("Radius of the circle")]
|
|
public float Radius = 1.0f;
|
|
}
|
|
|
|
public class OutputProperties
|
|
{
|
|
public Position r = Position.defaultValue;
|
|
}
|
|
|
|
public override string name
|
|
{
|
|
get
|
|
{
|
|
return "Sequential Circle";
|
|
}
|
|
}
|
|
|
|
[SerializeField, VFXSetting]
|
|
private VFXOperatorUtility.SequentialAddressingMode mode = VFXOperatorUtility.SequentialAddressingMode.Clamp;
|
|
|
|
protected override VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
|
|
{
|
|
var index = inputExpression[0];
|
|
var count = inputExpression[1];
|
|
var center = inputExpression[2];
|
|
var normal = inputExpression[3];
|
|
var up = inputExpression[4];
|
|
var radius = inputExpression[5];
|
|
|
|
return new[] { VFXOperatorUtility.SequentialCircle(center, radius, normal, up, index, count, mode) };
|
|
}
|
|
}
|
|
}
|