mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:24:07 +02:00
Improve speed of starting playing animations at server start-up
This commit is contained in:
parent
e91cf4a4e8
commit
ef8f36026c
1 changed files with 12 additions and 8 deletions
|
@ -279,15 +279,19 @@
|
|||
}
|
||||
|
||||
function autoPlay() {
|
||||
var recording;
|
||||
var recording,
|
||||
AUTOPLAY_SEARCH_DELTA = 1000; // TODO: Final value.
|
||||
|
||||
recording = Entity.find();
|
||||
if (recording) {
|
||||
log("Play persisted recording " + recordingFilename);
|
||||
playRecording(recording.recording, recording.position, recording.orientation);
|
||||
} else {
|
||||
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_SEARCH_INTERVAL); // Try again soon.
|
||||
}
|
||||
// Random delay to help reduce collisions between AC scripts.
|
||||
Script.setTimeout(function () {
|
||||
recording = Entity.find();
|
||||
if (recording) {
|
||||
log("Play persisted recording " + recordingFilename);
|
||||
playRecording(recording.recording, recording.position, recording.orientation);
|
||||
} else {
|
||||
autoPlayTimer = Script.setTimeout(autoPlay, AUTOPLAY_SEARCH_INTERVAL); // Try again soon.
|
||||
}
|
||||
}, Math.random() * AUTOPLAY_SEARCH_DELTA);
|
||||
}
|
||||
|
||||
playRecording = function (recording, position, orientation) {
|
||||
|
|
Loading…
Reference in a new issue