Skip to content

Commit fc2a1fa

Browse files
committed
Add AllCubesAssigned event
1 parent 6839b47 commit fc2a1fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Source/ROUtils/ProceduralTools/DragCubeTool.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ public class DragCubeTool : MonoBehaviour
3838

3939
public Part Part { get; private set; }
4040

41+
/// <summary>
42+
/// Invoked once all drag cubes have been generated and assigned to the part.
43+
/// </summary>
44+
public event EventHandler AllCubesAssigned;
45+
4146
/// <summary>
4247
/// Creates and assigns a drag cube for the given procedural part.
4348
/// This process can have one to many frames of delay.
@@ -119,6 +124,7 @@ private void UpdateCubes()
119124
else
120125
{
121126
UpdateCubes(Part, _shapeKey, _updateSymCounterparts);
127+
AllCubesAssigned?.Invoke(this, EventArgs.Empty);
122128
Destroy(this);
123129
}
124130
}
@@ -171,6 +177,7 @@ private bool TryUpdateMultiCubesFromCache()
171177

172178
NotifyFARIfNeeded(Part);
173179
EnsureStatsRoutineStarted(Part);
180+
AllCubesAssigned?.Invoke(this, EventArgs.Empty);
174181

175182
Destroy(this);
176183
}
@@ -261,6 +268,7 @@ private IEnumerator UpdateMultiCubesRoutine(bool isValidation = false)
261268

262269
NotifyFARIfNeeded(Part);
263270
EnsureStatsRoutineStarted(Part);
271+
AllCubesAssigned?.Invoke(this, EventArgs.Empty);
264272

265273
Destroy(this);
266274
}

0 commit comments

Comments
 (0)