Commit f2b33acb authored by Chunchi Che's avatar Chunchi Che

update visibility when hover

parent 5eff3f54
...@@ -89,6 +89,8 @@ function setupHandInteractivity( ...@@ -89,6 +89,8 @@ function setupHandInteractivity(
console.log(`<Interact>hand ${handIdx}`); console.log(`<Interact>hand ${handIdx}`);
}); });
advancedTexture.addControl(button); advancedTexture.addControl(button);
interact.visibility = 0;
} }
} }
...@@ -126,6 +128,9 @@ function setupHandAction( ...@@ -126,6 +128,9 @@ function setupHandAction(
BABYLON.ActionManager.OnPointerOverTrigger, BABYLON.ActionManager.OnPointerOverTrigger,
(event) => { (event) => {
console.log(`<Hover>hand: ${handIdx}`, "event: ", event); console.log(`<Hover>hand: ${handIdx}`, "event: ", event);
for (let child of mesh.getChildMeshes()) {
child.visibility = 1;
}
} }
), ),
] ]
...@@ -149,6 +154,9 @@ function setupHandAction( ...@@ -149,6 +154,9 @@ function setupHandAction(
BABYLON.ActionManager.OnPointerOutTrigger, BABYLON.ActionManager.OnPointerOutTrigger,
(event) => { (event) => {
console.log(`<Hover Out>hand: ${handIdx}`, "event:", event); console.log(`<Hover Out>hand: ${handIdx}`, "event:", event);
for (let child of mesh.getChildMeshes()) {
child.visibility = 0;
}
} }
), ),
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment