Browse Source

Serialized triggers of actions

moreau-mathis 9 years ago
parent
commit
fa8c06b8b8
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/Actions/babylon.actionManager.ts

+ 10 - 0
src/Actions/babylon.actionManager.ts

@@ -308,6 +308,16 @@
                     properties: []
                     properties: []
                 };
                 };
                 
                 
+                var triggerOptions = this.actions[i].triggerOptions;
+                if (triggerOptions) {
+                    if (triggerOptions instanceof Node) {
+                        triggerObject.properties.push(Action._GetTargetProperty(triggerOptions.trigger));
+                    }
+                    else {
+                        triggerObject.properties.push({ name: "parameter", value: triggerOptions.parameter });
+                    }
+                }
+                
                 // Serialize child action, recursively
                 // Serialize child action, recursively
                 this.actions[i].serialize(triggerObject);
                 this.actions[i].serialize(triggerObject);