Skip to content

Commit

Permalink
Hiding extra node balls in the editor.
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dog committed Jul 25, 2014
1 parent 42ec400 commit 21743b2
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Source/NodeNumberTweaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ public virtual void FixedUpdate()
}


public void Update()
{
if (HighLogic.LoadedSceneIsEditor)
{
for (int i=numNodes+1; i<=maxNumber; ++i)
{
var node=findNode(i);
if (node==null) continue;
part.attachNodes.Remove(node);
}
}
}


public override void OnStart(StartState state)
{
// print("NNT: OnStart "+state);
Expand Down Expand Up @@ -171,7 +185,8 @@ void addRemoveNodes()
var node=findNode(i);
if (node==null) continue;

part.attachNodes.Remove(node);
if (HighLogic.LoadedSceneIsEditor) node.position=new Vector3(10000, 0, 0);
else part.attachNodes.Remove(node);
}
}

Expand All @@ -193,6 +208,14 @@ void updateNodePositions()

if (!justLoaded) PFUtils.updateAttachedPartPos(node, part);
}

for (int i=numNodes+1; i<=maxNumber; ++i)
{
var node=findNode(i);
if (node==null) continue;

node.position=new Vector3(10000, 0, 0);
}
}
}

Expand Down

0 comments on commit 21743b2

Please sign in to comment.