mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:33:11 +02:00
Update bat.js to lazy load the pitching machine
This commit is contained in:
parent
def8294b60
commit
3cbcc6494f
1 changed files with 5 additions and 2 deletions
|
@ -1,8 +1,11 @@
|
||||||
(function() {
|
(function() {
|
||||||
Script.include("pitching.js");
|
Script.include("pitching.js");
|
||||||
var pitchingMachine = getPitchingMachine();
|
var pitchingMachine = null;
|
||||||
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
|
||||||
this.startNearGrab = function() {
|
this.startNearGrab = function() {
|
||||||
|
if (!pitchingMachine) {
|
||||||
|
getPitchingMachine();
|
||||||
|
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
|
||||||
|
}
|
||||||
print("Started near grab!");
|
print("Started near grab!");
|
||||||
pitchingMachine.start();
|
pitchingMachine.start();
|
||||||
MyAvatar.shouldRenderLocally = false;
|
MyAvatar.shouldRenderLocally = false;
|
||||||
|
|
Loading…
Reference in a new issue