using System.Collections.Generic;
using System.Linq;
namespace Unity.VisualScripting
{
///
/// Returns the sum of two or more scalars.
///
[UnitCategory("Math/Scalar")]
[UnitTitle("Add")]
public sealed class ScalarSum : Sum, IDefaultValue
{
[DoNotSerialize]
public float defaultValue => 1;
public override float Operation(float a, float b)
{
return a + b;
}
public override float Operation(IEnumerable values)
{
return values.Sum();
}
}
}