projects
/
pwl6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Install a hook from audio to animations if both are present.
[pwl6.git]
/
src
/
yuu
/
director.js
diff --git
a/src/yuu/director.js
b/src/yuu/director.js
index
a078ef5
..
7660b26
100644
(file)
--- a/
src/yuu/director.js
+++ b/
src/yuu/director.js
@@
-686,6
+686,14
@@
var director = yuu.director = new yuu.Director();
/** The standard director */
var director = yuu.director = new yuu.Director();
/** The standard director */
+ if (yuu.audio) {
+ yuu.Animation.registerOperation(function playSound (sound) {
+ if (Array.isArray(sound))
+ sound = yuu.random.choice(sound);
+ (new yuu.Instrument(sound)).play();
+ });
+ }
+
yuu.registerInitHook(function () {
return yuu.ready(director._scenes);
});
yuu.registerInitHook(function () {
return yuu.ready(director._scenes);
});