mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
removed commenting
This commit is contained in:
parent
120c5ac370
commit
a65c869239
1 changed files with 0 additions and 11 deletions
|
@ -58,24 +58,19 @@ function handleActiveSoundEntities() {
|
||||||
soundProperties.timeWithoutAvatarInRange += UPDATE_TIME;
|
soundProperties.timeWithoutAvatarInRange += UPDATE_TIME;
|
||||||
if (soundProperties.timeWithoutAvatarInRange > EXPIRATION_TIME && soundProperties.soundInjector) {
|
if (soundProperties.timeWithoutAvatarInRange > EXPIRATION_TIME && soundProperties.soundInjector) {
|
||||||
// An avatar hasn't been within range of this sound entity recently, so remove it from map
|
// An avatar hasn't been within range of this sound entity recently, so remove it from map
|
||||||
print("NO AVATARS HAVE BEEN AROUND FOR A WHILE SO REMOVE THIS SOUND FROM SOUNDMAP!");
|
|
||||||
soundProperties.soundInjector.stop();
|
soundProperties.soundInjector.stop();
|
||||||
delete soundEntityMap[soundEntity];
|
delete soundEntityMap[soundEntity];
|
||||||
} else if(soundProperties.isDownloaded) {
|
} else if(soundProperties.isDownloaded) {
|
||||||
print("WERE DOWNLOADED");
|
|
||||||
// If this sound hasn't expired yet, we want to potentially play it!
|
// If this sound hasn't expired yet, we want to potentially play it!
|
||||||
if (soundProperties.readyToPlay) {
|
if (soundProperties.readyToPlay) {
|
||||||
print("WERE READY TO PLAY")
|
|
||||||
var newPosition = Entities.getEntityProperties(soundEntity, "position").position;
|
var newPosition = Entities.getEntityProperties(soundEntity, "position").position;
|
||||||
if (!soundProperties.soundInjector) {
|
if (!soundProperties.soundInjector) {
|
||||||
print("PLAY SOUND!");
|
|
||||||
soundProperties.soundInjector = Audio.playSound(soundProperties.sound, {
|
soundProperties.soundInjector = Audio.playSound(soundProperties.sound, {
|
||||||
volume: soundProperties.volume,
|
volume: soundProperties.volume,
|
||||||
position: newPosition,
|
position: newPosition,
|
||||||
loop: soundProperties.loop
|
loop: soundProperties.loop
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
print ("RESTART INJECTOR!")
|
|
||||||
soundProperties.soundInjector.restart();
|
soundProperties.soundInjector.restart();
|
||||||
}
|
}
|
||||||
soundProperties.readyToPlay = false;
|
soundProperties.readyToPlay = false;
|
||||||
|
@ -83,7 +78,6 @@ function handleActiveSoundEntities() {
|
||||||
// We need to check all of our entities that are not looping but have an interval associated with them
|
// We need to check all of our entities that are not looping but have an interval associated with them
|
||||||
// to see if it's time for them to play again
|
// to see if it's time for them to play again
|
||||||
soundProperties.timeSinceLastPlay += UPDATE_TIME;
|
soundProperties.timeSinceLastPlay += UPDATE_TIME;
|
||||||
print("INCREMENT TIME SINCE LAST PLAY")
|
|
||||||
if (soundProperties.timeSinceLastPlay > soundProperties.currentInterval) {
|
if (soundProperties.timeSinceLastPlay > soundProperties.currentInterval) {
|
||||||
soundProperties.readyToPlay = true;
|
soundProperties.readyToPlay = true;
|
||||||
soundProperties.timeSinceLastPlay = 0;
|
soundProperties.timeSinceLastPlay = 0;
|
||||||
|
@ -103,7 +97,6 @@ function handleFoundSoundEntities(entities) {
|
||||||
if (soundData && soundData.url) {
|
if (soundData && soundData.url) {
|
||||||
//check sound entities list- if it's not in, add it
|
//check sound entities list- if it's not in, add it
|
||||||
if (!soundEntityMap[entity]) {
|
if (!soundEntityMap[entity]) {
|
||||||
print("FOUND A NEW SOUND ENTITY!")
|
|
||||||
var soundProperties = {
|
var soundProperties = {
|
||||||
url: soundData.url,
|
url: soundData.url,
|
||||||
volume: soundData.volume || DEFAULT_SOUND_DATA.volume,
|
volume: soundData.volume || DEFAULT_SOUND_DATA.volume,
|
||||||
|
@ -129,7 +122,6 @@ function handleFoundSoundEntities(entities) {
|
||||||
// Only add it to map once it's downloaded
|
// Only add it to map once it's downloaded
|
||||||
soundUrls[soundData.url] = sound;
|
soundUrls[soundData.url] = sound;
|
||||||
sound.ready.connect(function() {
|
sound.ready.connect(function() {
|
||||||
print("ADD TO MAP!")
|
|
||||||
soundProperties.sound = sound;
|
soundProperties.sound = sound;
|
||||||
soundProperties.readyToPlay = true;
|
soundProperties.readyToPlay = true;
|
||||||
soundProperties.isDownloaded = true;
|
soundProperties.isDownloaded = true;
|
||||||
|
@ -154,7 +146,6 @@ function handleFoundSoundEntities(entities) {
|
||||||
function checkForSoundPropertyChanges(currentProps, newProps) {
|
function checkForSoundPropertyChanges(currentProps, newProps) {
|
||||||
var needsUpdate = false;
|
var needsUpdate = false;
|
||||||
if (currentProps.volume !== newProps.volume) {
|
if (currentProps.volume !== newProps.volume) {
|
||||||
print("VOLUME CHANGED!!");
|
|
||||||
currentProps.volume = newProps.volume;
|
currentProps.volume = newProps.volume;
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +156,6 @@ function checkForSoundPropertyChanges(currentProps, newProps) {
|
||||||
var sound = SoundCache.getSound(currentProps.url);
|
var sound = SoundCache.getSound(currentProps.url);
|
||||||
currentProps.isDownloaded = false;
|
currentProps.isDownloaded = false;
|
||||||
sound.ready.connect(function() {
|
sound.ready.connect(function() {
|
||||||
print("Ready to play new sound!")
|
|
||||||
currentProps.sound = sound;
|
currentProps.sound = sound;
|
||||||
currentProps.isDownloaded = true;
|
currentProps.isDownloaded = true;
|
||||||
});
|
});
|
||||||
|
@ -175,7 +165,6 @@ function checkForSoundPropertyChanges(currentProps, newProps) {
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
if (needsUpdate) {
|
if (needsUpdate) {
|
||||||
print("UPDATING!");
|
|
||||||
// If we were looping we need to stop that so new changes are applied
|
// If we were looping we need to stop that so new changes are applied
|
||||||
currentProps.soundInjector.stop();
|
currentProps.soundInjector.stop();
|
||||||
currentProps.soundInjector = null;
|
currentProps.soundInjector = null;
|
||||||
|
|
Loading…
Reference in a new issue