Explorar o código

Can add event in animations

Fl0xer %!s(int64=7) %!d(string=hai) anos
pai
achega
a630e5253b
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      h3d/anim/Animation.hx

+ 9 - 0
h3d/anim/Animation.hx

@@ -87,6 +87,15 @@ class Animation {
 		}
 	}
 
+	public function addEvent(frame : Int, data : String) {
+		if (events == null)
+			events = [];
+		if (events[frame] == null)
+			events[frame] = [data];
+		else
+			events[frame].push(data);
+	}
+
 	public function setFrame( f : Float ) {
 		frame = f;
 		lastEvent = -1;