forked from LeenkxTeam/Leenkx_Examples
25 lines
587 B
Haxe
25 lines
587 B
Haxe
package lnx;
|
|
|
|
#if lnx_debug
|
|
import leenkx.trait.internal.DebugDraw;
|
|
#end
|
|
|
|
class MyTrait extends iron.Trait {
|
|
|
|
public function new() {
|
|
super();
|
|
notifyOnInit( () -> {
|
|
var plane = iron.Scene.active.getChild("Plane");
|
|
var suzanne = iron.Scene.active.getChild("Suzanne");
|
|
// To see debug drawing, `Leenkx Project - Debug Console` option has to be enabled
|
|
#if lnx_debug
|
|
DebugDraw.notifyOnRender( (draw:DebugDraw) -> {
|
|
if(plane != null) draw.bounds(plane.transform);
|
|
if(suzanne != null) draw.bounds(suzanne.transform);
|
|
// draw.line();
|
|
});
|
|
#end
|
|
});
|
|
}
|
|
}
|