simplify parameter deleted code
This commit is contained in:
@@ -427,13 +427,13 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool IsParamreferenced(SurfaceParameter param, VisjectSurface surface)
|
public bool IsParamreferenced(SurfaceParameter param)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < surface.Nodes.Count; i++)
|
for (int i = 0; i < Surface.Nodes.Count; i++)
|
||||||
{
|
{
|
||||||
if (surface.Nodes[i] is IParametersDependantNode node)
|
if (Surface.Nodes[i] is IParametersDependantNode node)
|
||||||
{
|
{
|
||||||
return (Guid)surface.Nodes[i].Values[0] == param.ID && surface.Nodes[i].GetBoxes().Any(b => b.Connections.Count > 0);
|
return (Guid)Values[0] == param.ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -958,13 +958,13 @@ namespace FlaxEditor.Surface.Archetypes
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool IsParamreferenced(SurfaceParameter param, VisjectSurface surface)
|
public bool IsParamreferenced(SurfaceParameter param)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < surface.Nodes.Count; i++)
|
for (int i = 0; i < Surface.Nodes.Count; i++)
|
||||||
{
|
{
|
||||||
if (surface.Nodes[i] is IParametersDependantNode node)
|
if (Surface.Nodes[i] is IParametersDependantNode node)
|
||||||
{
|
{
|
||||||
return (Guid)surface.Nodes[i].Values[0] == param.ID && surface.Nodes[i].GetBoxes().Any(b => b.Connections.Count > 0);
|
return (Guid)Values[0] == param.ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,7 @@ namespace FlaxEditor.Surface
|
|||||||
/// Get if the parameter is referenced in a graph. Referenced in this case means in a graph and at least one node in-/output connected to another node.
|
/// Get if the parameter is referenced in a graph. Referenced in this case means in a graph and at least one node in-/output connected to another node.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="param">The parameter.</param>
|
/// <param name="param">The parameter.</param>
|
||||||
/// <param name="surface">The visject surface.</param>
|
|
||||||
/// <returns>If the parameter is referenced.</returns>
|
/// <returns>If the parameter is referenced.</returns>
|
||||||
bool IsParamreferenced(SurfaceParameter param, VisjectSurface surface);
|
bool IsParamreferenced(SurfaceParameter param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -788,7 +788,7 @@ namespace FlaxEditor.Surface
|
|||||||
{
|
{
|
||||||
if (nodes[i] is IParametersDependantNode node)
|
if (nodes[i] is IParametersDependantNode node)
|
||||||
{
|
{
|
||||||
if (displayWarning && node.IsParamreferenced(param, window.VisjectSurface))
|
if (displayWarning && node.IsParamreferenced(param))
|
||||||
connectedParameterNodeCount++;
|
connectedParameterNodeCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user