Hello,
I am having trouble trying to highlight a mesh like in this playground example using typescript in Unity.
Here is my typescript:
module PROJECT {
export class Highlight extends BABYLON.MeshComponent {
owner: BABYLON.AbstractMesh;
scene: BABYLON.Scene;
public constructor(owner: BABYLON.AbstractMesh, scene: BABYLON.Scene, tick: boolean = true, propertyBag: any = {}) {
super(owner, scene, tick, propertyBag);
this.owner = owner;
this.scene = scene;
}
protected ready() :void {
// Scene execute when ready
}
protected start() :void {
// Start component function
var hl = new BABYLON.HighlightLayer("hl", this.scene);
var material1 = new BABYLON.StandardMaterial("mat1", this.scene);
material1.diffuseColor = new BABYLON.Color3(1, 1, 0);
//Apply Highlight layer to box
hl.addMesh(this.owner, BABYLON.Color3.White());
}
...
}
}
The problem is, .addMesh() only accepts a Mesh type and not an AbstractMesh type. Is there a way to convert an AbstractMesh or another way to accomplish highlighting?
Any suggestions would be great. I’m still very new to Babylon.js and the documentation for the Unity exporter isn’t extremely detailed, so I appreciate your patience.
Thanks,
Stefan