using System; using System.Collections.Generic; using UnityEngine; namespace Unity.VisualScripting { /// /// Returns the sum of two or more 3D vectors. /// [UnitCategory("Math/Vector 3")] [UnitTitle("Add")] public sealed class Vector3Sum : Sum, IDefaultValue { [DoNotSerialize] public Vector3 defaultValue => Vector3.zero; public override Vector3 Operation(Vector3 a, Vector3 b) { return a + b; } public override Vector3 Operation(IEnumerable values) { var sum = Vector3.zero; foreach (var value in values) { sum += value; } return sum; } } }