Explorar el Código

Cinematic, made sure an event is properly initialized when added during playback

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10017 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om hace 12 años
padre
commit
6a455731c7
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      engine/src/core/com/jme3/cinematic/Cinematic.java

+ 7 - 4
engine/src/core/com/jme3/cinematic/Cinematic.java

@@ -258,12 +258,15 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
             timeLine.addKeyFrameAtTime(timeStamp, keyFrame);
         }
         keyFrame.cinematicEvents.add(cinematicEvent);
-        cinematicEvents.add(cinematicEvent);
+        cinematicEvents.add(cinematicEvent);        
+        if(isInitialized()){
+            cinematicEvent.initEvent(null, this);
+        }
         return keyFrame;
     }
 
     /**
-     * removes the first occurence found of the given cinematicEvent.
+     * removes the first occurrence found of the given cinematicEvent.
      *
      * @param cinematicEvent the cinematicEvent to remove
      * @return true if the element has been removed
@@ -279,7 +282,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
     }
 
     /**
-     * removes the first occurence found of the given cinematicEvent for the given time stamp.
+     * removes the first occurrence found of the given cinematicEvent for the given time stamp.
      * @param timeStamp the timestamp when the cinematicEvent has been added
      * @param cinematicEvent the cinematicEvent to remove
      * @return true if the element has been removed
@@ -290,7 +293,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState {
     }
     
     /**
-     * removes the first occurence found of the given cinematicEvent for the given keyFrame
+     * removes the first occurrence found of the given cinematicEvent for the given keyFrame
      * @param keyFrame the keyFrame returned by the addCinematicEvent method.
      * @param cinematicEvent the cinematicEvent to remove
      * @return true if the element has been removed