mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Don't render overlay unless debug
This commit is contained in:
parent
54980f46a9
commit
10ac6bc9ca
1 changed files with 15 additions and 11 deletions
|
@ -17,7 +17,7 @@ var RainSquall = function (properties) {
|
|||
dropSize = { x: 0.1, y: 0.1, z: 0.1 },
|
||||
dropFallSpeed = 1, // m/s
|
||||
dropLifetime = 60, // Seconds
|
||||
debug = false, // Display origin circle
|
||||
debug = false, // Display origin circle; don't use running on Stack Manager
|
||||
// Other
|
||||
squallCircle,
|
||||
SQUALL_CIRCLE_COLOR = { red: 255, green: 0, blue: 0 },
|
||||
|
@ -84,22 +84,26 @@ var RainSquall = function (properties) {
|
|||
}
|
||||
|
||||
function setUp() {
|
||||
squallCircle = Overlays.addOverlay("circle3d", {
|
||||
size: { x: 2 * squallRadius, y: 2 * squallRadius },
|
||||
color: SQUALL_CIRCLE_COLOR,
|
||||
alpha: SQUALL_CIRCLE_ALPHA,
|
||||
solid: true,
|
||||
visible: debug,
|
||||
position: squallOrigin,
|
||||
rotation: SQUALL_CIRCLE_ROTATION
|
||||
});
|
||||
if (debug) {
|
||||
squallCircle = Overlays.addOverlay("circle3d", {
|
||||
size: { x: 2 * squallRadius, y: 2 * squallRadius },
|
||||
color: SQUALL_CIRCLE_COLOR,
|
||||
alpha: SQUALL_CIRCLE_ALPHA,
|
||||
solid: true,
|
||||
visible: debug,
|
||||
position: squallOrigin,
|
||||
rotation: SQUALL_CIRCLE_ROTATION
|
||||
});
|
||||
}
|
||||
|
||||
raindropTimer = Script.setInterval(createRaindrop, 60000 / dropsPerMinute);
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
Script.clearInterval(raindropTimer);
|
||||
Overlays.deleteOverlay(squallCircle);
|
||||
if (debug) {
|
||||
Overlays.deleteOverlay(squallCircle);
|
||||
}
|
||||
}
|
||||
|
||||
processProperties();
|
||||
|
|
Loading…
Reference in a new issue