Class NearInteractionTouchable
Add a NearInteractionTouchable to your scene and configure a touchable surface
in order to get PointerDown and PointerUp events whenever a PokePointer touches this surface.
Inheritance
NearInteractionTouchable
Assembly: cs.temp.dll.dll
public class NearInteractionTouchable : NearInteractionTouchableSurface
Fields
Declaration
Field Value
Declaration
protected Vector3 localCenter
Field Value
Declaration
protected Vector3 localForward
Field Value
Declaration
protected Vector3 localUp
Field Value
Properties
Returns true if the LocalForward and LocalUp vectors are orthogonal.
Declaration
public bool AreLocalVectorsOrthogonal { get; }
Property Value
Bounds or size of the 2D NearInteractionTouchablePlane
Declaration
public override Vector2 Bounds { get; }
Property Value
Overrides
Check if the touchableCollider is enabled and in the gameObject hierarchy
Declaration
public bool ColliderEnabled { get; }
Property Value
Forward direction of the gameObject
Declaration
public Vector3 Forward { get; }
Property Value
Local space object center
Declaration
public override Vector3 LocalCenter { get; }
Property Value
Overrides
Local space forward direction
Declaration
public Vector3 LocalForward { get; }
Property Value
Forward direction of the NearInteractionTouchable plane, the press direction needs to face the
camera.
Declaration
public override Vector3 LocalPressDirection { get; }
Property Value
Overrides
Local space and gameObject right
Declaration
public Vector3 LocalRight { get; }
Property Value
Declaration
public Vector3 LocalUp { get; }
Property Value
BoxCollider used to calculate bounds and local center, if not set before runtime the gameObjects's BoxCollider will be used by default
Declaration
public Collider TouchableCollider { get; }
Property Value
Type |
Description |
Collider |
|
Methods
Declaration
public override float DistanceToTouchable(Vector3 samplePoint, out Vector3 normal)
Parameters
Type |
Name |
Description |
Vector3 |
samplePoint |
|
Vector3 |
normal |
|
Returns
Overrides
Declaration
protected override void OnValidate()
Overrides
Set the size (bounds) of the 2D NearInteractionTouchable plane.
Declaration
public void SetBounds(Vector2 newBounds)
Parameters
Type |
Name |
Description |
Vector2 |
newBounds |
|
Set the position (center) of the NearInteractionTouchable plane relative to the gameObject.
The position of the plane should be in front of the gameObject.
Declaration
public void SetLocalCenter(Vector3 newLocalCenter)
Parameters
Type |
Name |
Description |
Vector3 |
newLocalCenter |
|
Set local forward direction and ensure that local up is perpendicular to the new local forward and
local right direction. The forward position should be facing the camera. The direction is indicated in scene view by a
white arrow in the center of the plane.
Declaration
public void SetLocalForward(Vector3 newLocalForward)
Parameters
Type |
Name |
Description |
Vector3 |
newLocalForward |
|
Set new local up direction and ensure that local forward is perpendicular to the new local up and
local right direction.
Declaration
public void SetLocalUp(Vector3 newLocalUp)
Parameters
Type |
Name |
Description |
Vector3 |
newLocalUp |
|
Adjust the bounds, local center and local forward to match a given box collider. This method
also changes the size of the box collider attached to the gameObject.
Default Behavior: if touchableCollider is null at runtime, the object's box collider will be used
to size and place the NearInteractionTouchable plane in front of the gameObject
Declaration
public void SetTouchableCollider(BoxCollider newCollider)
Parameters
Type |
Name |
Description |
BoxCollider |
newCollider |
|