Sink component for removing MUs from the simulation, representing endpoints in material flow systems. More...

Public Member Functions | |
void | DeleteMUs () |
Deletes all MUs currently in the sink area. | |
![]() | |
void | PreStartSim () |
Is called by the realvirtualController before the component is started. | |
void | StartSim () |
Is called by the realvirtualController to start or stop the component. | |
void | StopSim () |
Vector3 | DirectionToVector (DIRECTION direction) |
Transfers the direction enumeration to a vector. | |
DIRECTION | VectorToDirection (bool torotatoin, Vector3 vector) |
Transfers a vector to the direction enumeration. | |
float | GetLocalScale (Transform thetransform, DIRECTION direction) |
List< BehaviorInterfaceConnection > | UpdateConnectionInfo () |
List< Signal > | GetConnectedSignals () |
void | SetVisibility (bool visibility) |
Sets the visibility of this object including all subobjects. | |
List< BehaviorInterfaceConnection > | GetConnections () |
List< Signal > | GetSignals () |
GameObject | GetChildByName (string name) |
Gets a child by name. | |
List< GameObject > | GetChildsByName (string name) |
Gets all child by name. | |
GameObject | GetChildByNameAlsoHidden (string name) |
List< GameObject > | GetAllMeshesWithGroup (string group) |
List< GameObject > | GetAllWithGroup (string group) |
List< GameObject > | GetAllWithGroups (List< string > groups) |
List< GameObject > | GetAllMeshesWithGroups (List< string > groups) |
List< string > | GetMyGroups () |
List< GameObject > | GetMeshesWithSameGroups () |
List< GameObject > | GetAllWithSameGroups () |
MeshRenderer | GetMeshRenderer () |
Gets the mesh renderers in the childrens. | |
void | SetCollider (bool enabled) |
sets the collider in all child objects | |
void | ErrorMessage (string message) |
Displays an error message. | |
void | ChangeConnectionMode (bool isconnected) |
void | Log (string message) |
Logs a message. | |
void | Log (string message, object obj) |
Logs a message with a relation to an object. | |
void | Warning (string message, object obj) |
Logs a warinng with a relation to an object. | |
void | Error (string message, object obj) |
Logs an error with a relation to an object. | |
void | Error (string message) |
Logs an error. | |
GameObject | DebugPosition (string debugname, Vector3 position, Quaternion quaternation, float scale) |
Displays a gizmo for debugging positions. | |
void | SetFreezePosition (bool enabled) |
Freezes all child components to the current poosition. | |
void | SetRbConstraints (RigidbodyConstraints constraints) |
virtual void | AwakeAlsoDeactivated () |
Public Attributes | |
bool | UseAGXPhysics |
bool | DeleteMus |
Delete MUs. | |
bool | Dissolve |
Dissolve MUs. | |
string | DeleteOnlyTag |
Delete only MUs with defined Tag. | |
float | DestroyFadeTime |
Time in seconds to fade out MU. | |
PLCOutputBool | Delete |
PLC output for deleting MUs. | |
float | SumDestroyed |
Sum of destroyed objects. | |
float | DestroyedPerHour |
Sum of destroyed objects per Hour. | |
List< GameObject > | CollidingObjects |
Currently colliding objects. | |
SinkEventOnDestroy | OnMUDelete |
Event triggered when an MU is deleted by the sink. | |
![]() | |
string | Name |
The name of the component if it should be different from the GameObject name. | |
ActiveOnly | Active |
GameObject | FromTemplate |
realvirtualController | realvirtualController |
bool | HideNonG44Components |
bool | SceneIsAdditive |
bool | ForceStop |
Additional Inherited Members | |
![]() | |
enum | ActiveOnly { Always , Connected , Disconnected , Never , DontChange } |
![]() | |
static bool | DirectionIsLinear (DIRECTION direction) |
Gets back if the direction is linear or a rotation. | |
![]() | |
bool | hidename () |
bool | hideactiveonly () |
virtual void | OnStopSim () |
virtual void | OnPreStartSim () |
virtual void | OnStartSim () |
MU | GetTopOfMu (GameObject obj) |
Gets the top of an MU component (the first MU script going up in the hierarchy) | |
void | InitGame4Automation () |
Initialiates the components and gets the reference to the realvirtualController in the scene. | |
virtual void | AfterAwake () |
void | Awake () |
Detailed Description
Sink component for removing MUs from the simulation, representing endpoints in material flow systems.
The Sink is a fundamental component in realvirtual that acts as the termination point for MUs in the automation system. It simulates various endpoints such as shipping areas, quality control rejection points, recycling stations, or any location where products exit the simulated system. Sinks automatically detect and remove MUs that enter their trigger area.
Key Features:
- Automatic detection and removal of MUs entering the sink area
- Optional visual dissolve effect for smooth MU disappearance
- Selective deletion based on MU tags for filtering specific products
- Production statistics tracking (total destroyed, rate per hour)
- PLC signal integration for controlled deletion
- Collision-based detection using Unity trigger colliders
- Support for both immediate and delayed destruction
- Event system for tracking destroyed MUs
Common Applications:
- End of production lines where finished products exit
- Quality control stations removing defective items
- Shipping and dispatch areas
- Recycling and waste collection points
- Buffer overflow handling
- Testing and validation endpoints
- Order fulfillment completion points
- Rework station exits
Operation Modes:
- Automatic Mode: MUs are destroyed immediately upon entering
- PLC Controlled: Deletion triggered by PLC signals
- Selective Mode: Only specific tagged MUs are destroyed
- Statistical Mode: Tracks throughput without deletion
Visual Effects:
- Dissolve Effect: Smooth fade-out using shader-based dissolution
- Configurable fade duration for visual feedback
- Compatible with standard and custom shaders
- Optional immediate destruction without effects
Statistics and Monitoring:
- SumDestroyed: Total count of destroyed MUs
- DestroyedPerHour: Current throughput rate calculation
- CollidingObjects: Real-time list of MUs in sink area
- Event notifications for external tracking systems
PLC Integration:
- Delete Signal: Triggers deletion of all MUs currently in sink
- Can be integrated with production control systems
- Supports batch processing scenarios
Performance Considerations:
- Efficient trigger-based detection
- Automatic cleanup of destroyed objects
- Optimized for high-throughput scenarios
- Minimal impact on simulation performance
Events:
- OnMUDelete: Fired when an MU is destroyed
- Provides destroyed MU reference for logging or statistics
Setup Requirements:
- Requires BoxCollider component set as trigger
- Automatically configured on component addition
- Size determines the detection area
For detailed documentation see: https://doc.realvirtual.io/components-and-scripts/sink
Member Function Documentation
◆ DeleteMUs()
void realvirtual.Sink.DeleteMUs | ( | ) |
Deletes all MUs currently in the sink area.
Member Data Documentation
◆ CollidingObjects
List<GameObject> realvirtual.Sink.CollidingObjects |
Currently colliding objects.
◆ Delete
PLCOutputBool realvirtual.Sink.Delete |
PLC output for deleting MUs.
◆ DeleteMus
bool realvirtual.Sink.DeleteMus |
Delete MUs.
◆ DeleteOnlyTag
string realvirtual.Sink.DeleteOnlyTag |
Delete only MUs with defined Tag.
◆ DestroyedPerHour
float realvirtual.Sink.DestroyedPerHour |
Sum of destroyed objects per Hour.
◆ DestroyFadeTime
float realvirtual.Sink.DestroyFadeTime |
Time in seconds to fade out MU.
◆ Dissolve
bool realvirtual.Sink.Dissolve |
Dissolve MUs.
◆ OnMUDelete
SinkEventOnDestroy realvirtual.Sink.OnMUDelete |
Event triggered when an MU is deleted by the sink.
◆ SumDestroyed
float realvirtual.Sink.SumDestroyed |
Sum of destroyed objects.