Add Array constant node to Visual Script and Anim Graph

This commit is contained in:
Wojciech Figat
2021-11-18 16:35:07 +01:00
parent cdcb2f8f7a
commit 502a67a75a
11 changed files with 408 additions and 134 deletions

View File

@@ -62,14 +62,15 @@ namespace FlaxEditor.Surface.Elements
/// </summary>
/// <param name="parentNode">The parent node.</param>
/// <param name="arch">The node element archetype.</param>
/// <param name="customValue">The custom value override (optional).</param>
/// <returns>The result value.</returns>
public static float Get(SurfaceNode parentNode, NodeElementArchetype arch)
public static float Get(SurfaceNode parentNode, NodeElementArchetype arch, object customValue = null)
{
if (arch.ValueIndex < 0)
if (arch.ValueIndex < 0 && customValue == null)
return 0;
float result;
var value = parentNode.Values[arch.ValueIndex];
var value = customValue ?? parentNode.Values[arch.ValueIndex];
// Note: this value box may edit on component of the vector like Vector3.Y, BoxID from Archetype tells which component pick