Class PlantPlacard
Simple script to instantiate and place a prefab in the scene where tapped. If the air tap hits a previously placed object, it will be deleted.
Implements
IMixedRealityPointerHandler
Namespace: Microsoft.MixedReality.WorldLocking.Samples.Advanced.AlignSubScene
Assembly: cs.temp.dll.dll
Syntax
public class PlantPlacard : InputSystemGlobalHandlerListener, IMixedRealityPointerHandler
Remarks
This script assumes the prefab is of the layer "Pillared". Anything of layer "Pillared" will be considered to have been added by this script, and hence removed if tapped.
Fields
placardPrefab
The prefab to instantiate and place in the scene.
Declaration
public GameObject placardPrefab
Field Value
Type | Description |
---|---|
GameObject |
Methods
OnPointerClicked(MixedRealityPointerEventData)
Process pointer clicked event if ray cast has result.
Declaration
public void OnPointerClicked(MixedRealityPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityPointerEventData | eventData |
OnPointerDown(MixedRealityPointerEventData)
No-op on pointer down.
Declaration
public void OnPointerDown(MixedRealityPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityPointerEventData | eventData |
OnPointerDragged(MixedRealityPointerEventData)
No-op on pointer drag.
Declaration
public void OnPointerDragged(MixedRealityPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityPointerEventData | eventData |
OnPointerUp(MixedRealityPointerEventData)
No-op on pointer up.
Declaration
public void OnPointerUp(MixedRealityPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
MixedRealityPointerEventData | eventData |
RegisterHandlers()
Declaration
protected override void RegisterHandlers()
Start()
Cache our layers at start.
Declaration
protected override void Start()
TestLayer(GameObject, Int32)
Declaration
public static bool TestLayer(GameObject go, int layerTest)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | |
Int32 | layerTest |
Returns
Type | Description |
---|---|
Boolean |
UnregisterHandlers()
Declaration
protected override void UnregisterHandlers()
Implements
IMixedRealityPointerHandler