Tanoda
|
This example script constructs behavior for a very specific kind of UI object that can animate out a "workstation" panel when thrown or placed outside of an anchor. More...
Public Types | |
enum | WorkstationState { Closed , Traveling , Opening , Open , Closing } |
Public Member Functions | |
void | ActivateWorkstation () |
void | DeactivateWorkstation () |
delegate Vector3 | WorkstationPositionFunc (Vector3 userEyePosition, Quaternion userEyeRotation, Vector3 workstationObjInitPosition, Vector3 workstationObjInitVelocity, float workstationObjRadius, List< Vector3 > otherWorkstationPositions, List< float > otherWorkstationRadii) |
delegate Quaternion | WorkstationRotationFunc (Vector3 userEyePosition, Vector3 targetWorkstationPosition) |
Static Public Member Functions | |
static Vector3 | DefaultDetermineWorkstationPosition (Vector3 userEyePosition, Quaternion userEyeRotation, Vector3 workstationObjInitPosition, Vector3 workstationObjInitVelocity, float workstationObjRadius, List< Vector3 > otherWorkstationPositions, List< float > otherWorkstationRadii) |
static Quaternion | DefaultDetermineWorkstationRotation (Vector3 userEyePos, Vector3 workstationPosition) |
Public Attributes | |
TransformTweenBehaviour | workstationModeTween |
WorkstationPositionFunc | workstationPositionFunc |
The function used to calculate this workstation's target position. By default, will attempt to choose a nearby position approximately in front of the user and in the direction the workstation object is currently traveling, and a position that doesn't overlap with other workstations. The default method is set on Awake(), so it can be overridden in OnEnable() or Start(). More... | |
WorkstationRotationFunc | workstationRotationFunc |
The function used to calculate this workstation's target rotation. By default, will make the workstation's forward vector face the camera while aligning its upward vector against gravity. More... | |
Static Public Attributes | |
const float | MAX_SPEED_AS_WORKSTATION = 0.005F |
If the rigidbody of this object moves faster than this speed and the object is in workstation mode, it will exit workstation mode. More... | |
const float | MIN_SPEED_TO_ACTIVATE_TRAVELING = 0.5F |
If the rigidbody of this object moves slower than this speed and the object wants to enter workstation mode, it will first pick a target position and travel there. (Otherwise, it will open its workstation in-place.) More... | |
Properties | |
bool | isTraveling [get] |
Gets whether the workstation is currently traveling to a target position to open in workstation mode. Will return false if it is not traveling due to not being in workstation mode or if it has already reached its target position. More... | |
WorkstationState | workstationState [get] |
This example script constructs behavior for a very specific kind of UI object that can animate out a "workstation" panel when thrown or placed outside of an anchor.
Workstation objects exhibit the following behaviors:
It is a more complicated example that demonstrates using InteractionBehaviours and AnchorableBehaviours to create novel UI behavior.
Definition at line 37 of file WorkstationBehaviourExample.cs.
Enumerator | |
---|---|
Closed | |
Traveling | |
Opening | |
Open | |
Closing |
Definition at line 66 of file WorkstationBehaviourExample.cs.
void Leap.Unity.Examples.WorkstationBehaviourExample.ActivateWorkstation | ( | ) |
Definition at line 113 of file WorkstationBehaviourExample.cs.
void Leap.Unity.Examples.WorkstationBehaviourExample.DeactivateWorkstation | ( | ) |
Definition at line 122 of file WorkstationBehaviourExample.cs.
|
static |
Definition at line 312 of file WorkstationBehaviourExample.cs.
|
static |
Definition at line 363 of file WorkstationBehaviourExample.cs.
delegate Vector3 Leap.Unity.Examples.WorkstationBehaviourExample.WorkstationPositionFunc | ( | Vector3 | userEyePosition, |
Quaternion | userEyeRotation, | ||
Vector3 | workstationObjInitPosition, | ||
Vector3 | workstationObjInitVelocity, | ||
float | workstationObjRadius, | ||
List< Vector3 > | otherWorkstationPositions, | ||
List< float > | otherWorkstationRadii | ||
) |
delegate Quaternion Leap.Unity.Examples.WorkstationBehaviourExample.WorkstationRotationFunc | ( | Vector3 | userEyePosition, |
Vector3 | targetWorkstationPosition | ||
) |
|
static |
If the rigidbody of this object moves faster than this speed and the object is in workstation mode, it will exit workstation mode.
Definition at line 43 of file WorkstationBehaviourExample.cs.
|
static |
If the rigidbody of this object moves slower than this speed and the object wants to enter workstation mode, it will first pick a target position and travel there. (Otherwise, it will open its workstation in-place.)
Definition at line 50 of file WorkstationBehaviourExample.cs.
TransformTweenBehaviour Leap.Unity.Examples.WorkstationBehaviourExample.workstationModeTween |
Definition at line 52 of file WorkstationBehaviourExample.cs.
WorkstationPositionFunc Leap.Unity.Examples.WorkstationBehaviourExample.workstationPositionFunc |
The function used to calculate this workstation's target position. By default, will attempt to choose a nearby position approximately in front of the user and in the direction the workstation object is currently traveling, and a position that doesn't overlap with other workstations. The default method is set on Awake(), so it can be overridden in OnEnable() or Start().
Definition at line 285 of file WorkstationBehaviourExample.cs.
WorkstationRotationFunc Leap.Unity.Examples.WorkstationBehaviourExample.workstationRotationFunc |
The function used to calculate this workstation's target rotation. By default, will make the workstation's forward vector face the camera while aligning its upward vector against gravity.
Definition at line 291 of file WorkstationBehaviourExample.cs.
|
get |
Gets whether the workstation is currently traveling to a target position to open in workstation mode. Will return false if it is not traveling due to not being in workstation mode or if it has already reached its target position.
Definition at line 64 of file WorkstationBehaviourExample.cs.
|
get |
Definition at line 67 of file WorkstationBehaviourExample.cs.