Remove unused cache.
[pwl6.git] / src / yuu / director.js
index 83103b3..7660b26 100644 (file)
@@ -1,7 +1,7 @@
 /* Copyright 2014 Yukkuri Games
    Licensed under the terms of the GNU GPL v2 or later
-   @license http://www.gnu.org/licenses/gpl-2.0.html
-   @source: http://yukkurigames.com/yuu/
+   @license https://www.gnu.org/licenses/gpl-2.0.html
+   @source: https://yukkurigames.com/yuu/
 */
 
 (function (yuu) {
         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);
         });