game4automation.Drive Class Reference

The drive is moving components including all sub components along the local axis of the game object. More...

Inheritance diagram for game4automation.Drive:
game4automation.BaseDrive game4automation.Game4AutomationBehavior

Public Member Functions

delegate void OnAtPositionEvent (Drive drive)
 Delegate function for the Drive reaching the desitionationPosition.
 
delegate void OnJumpToLowerLimitEvent (Drive drive)
 
void Forward ()
 Starts the drive to move forward with the target speed.
 
void Backward ()
 Starts the drive to move forward with the target speed.
 
void DriveTo (float Target)
 Starts the drive to drive to the given Target with the target speed.
 
void Accelerate ()
 Starts the drive - it will speed up with sinoide if turned on.
 
void Decelerate ()
 
void Stop ()
 Stops the drive at the current position.
 
Vector3 GetLocalDirection ()
 Gets the axis vector of the drive.
 
void StartEditorMoveMode ()
 
void SetPositionEditorMoveMode (float editorposition)
 
void EndEditorMoveMode ()
 
Vector3 GetStartPos ()
 Gets the start position of the drive in local scale.
 
Vector3 GetStartRot ()
 Gets the start position of the drive in local scale.
 
void SetDriveTransformToZero ()
 Sets the position of the drive to 0.
 
void SetDriveTransformToValue (float value)
 Sets the position of the drive to the given value. More...
 
void AddTransportSurface (TransportSurface trans)
 Adds a Transport Surface to the Drive.
 
void RemoveTransportSurface (TransportSurface trans)
 Removes a Transport Surface fron the Drive.
 
void CalculateVectors ()
 
void DriveReset ()
 
- Public Member Functions inherited from game4automation.Game4AutomationBehavior
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< BehaviorInterfaceConnectionUpdateConnectionInfo ()
 
List< SignalGetConnectedSignals ()
 
void SetVisibility (bool visibility)
 Sets the visibility of this object including all subobjects.
 
List< BehaviorInterfaceConnectionGetConnections ()
 
List< SignalGetSignals ()
 
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.
 
virtual void AwakeAlsoDeactivated ()
 

Public Attributes

DIRECTION Direction
 The direction in local coordinate system of the GameObject where the drive is attached to.
 
bool ReverseDirection
 Set to true if Direction needs to be inverted.
 
float Offset
 Start offset of the drive from zero position in millimeters or degrees.
 
float StartPosition
 Start Position off the Drive.
 
float SpeedScaleTransportSurface
 Scale of the Speed for radial transportsurfaces to feed in mm/s on radius. More...
 
bool MoveThisRigidBody
 If set to true the RigidBodies are moved (use it if moving) part has attached colliders, if false the transforms are moved. More...
 
bool EditorMoveMode = false
 
List< TransportSurfaceTransportSurfaces
 The transport surface the drive is controlling. Is null if drive is not controlling a transport surface.
 
bool UseLimits
 
float LowerLimit = 0
 
float UpperLimit = 1000
 Lower Drive Limit, Upper and Lower = 0 if this should not be used.
 
bool JumpToLowerLimitOnUpperLimit = false
 Lower Drive Limit, Upper and Lower = 0 if this should not be used.
 
Sensor LimitRayCast
 
bool UseAcceleration = false
 If set to true the drive uses the acceleration.
 
bool SmoothAcceleration = false
 if set to true the drive uses smooth acceleration with a sinoide function
 
float Acceleration = 100
 The acceleration in millimeter per second^2.
 
bool JogForward = false
 A jog bit for jogging forward with the Target Speed.
 
bool JogBackward = false
 A jog bit for jogging backwards with the Target Speed.
 
float TargetPosition
 The target position of the Drive.
 
float TargetSpeed = 100
 The target speed in millimeter / second of the Drive.
 
bool TargetStartMove = false
 When changing to true the Drive is starting to move to the TargetPosition.
 
bool BlockDestination
 If Block Drive is true it will not drive to its Target Positon, Jogging is possible. More...
 
bool ResetDrive = false
 Resets the Drive to the zero position and stops all movements.
 
bool _StopDrive = false
 Stops the Drive at the current position.
 
float CurrentSpeed
 The current speed of the drive.
 
float CurrentPosition
 The current position of the drive.
 
bool IsStopped = false
 Is true if Drive is stopped.
 
bool IsRunning = false
 Is true if Drive is running.
 
bool IsAtTargetSpeed = false
 Is true if Drive is running.
 
bool IsAtTarget = false
 Is true if Drive is at target position.
 
bool IsAtLowerLimit = false
 Is true if Drive is jogging and reaching lower Limit.
 
bool IsAtUpperLimit = false
 Is true if Drive is jogging and reaching upper Limit.
 
bool HideGizmos = false
 
bool UseInteract = false
 
bool IsRotation = false
 
- Public Attributes inherited from game4automation.Game4AutomationBehavior
string Name
 The name of the component if it should be different from the GameObject name.
 
ActiveOnly Active
 
GameObject FromTemplate
 
Game4AutomationController Game4AutomationController
 
bool HideNonG44Components
 

Events

OnAtPositionEvent OnAtPosition
 
OnJumpToLowerLimitEvent OnJumpToLowerLimit
 

Additional Inherited Members

- Public Types inherited from game4automation.Game4AutomationBehavior
enum  ActiveOnly {
  Always, Connected, Disconnected, Never,
  DontChange
}
 
- Static Public Member Functions inherited from game4automation.Game4AutomationBehavior
static bool DirectionIsLinear (DIRECTION direction)
 Gets back if the direction is linear or a rotation.
 
- Protected Member Functions inherited from game4automation.Game4AutomationBehavior
bool hidename ()
 
bool hideactiveonly ()
 
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 Game4AutomationController in the scene.
 
virtual void AfterAwake ()
 
void Awake ()
 

Detailed Description

Rotational and linear movements are possible. A drive can be enhanced by DriveBehaviours which are adding special behaviours as well as Input and Output signals to drives.

Member Function Documentation

◆ SetDriveTransformToValue()

void game4automation.Drive.SetDriveTransformToValue ( float  value)
Parameters
valuethe position the drive in millimeters or degrees

Member Data Documentation

◆ BlockDestination

bool game4automation.Drive.BlockDestination
Initial value:
=
true

◆ MoveThisRigidBody

bool game4automation.Drive.MoveThisRigidBody
Initial value:
=
false

◆ SpeedScaleTransportSurface

float game4automation.Drive.SpeedScaleTransportSurface
Initial value:
=
1