Changes between Version 15 and Version 16 of Triggers
- Timestamp:
- Jun 24, 2014, 9:38:04 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Triggers
v15 v16 103 103 }}} 104 104 105 '''Note:''' both the `Trigger` prototype (e.g. `Trigger.prototype. whatIWantedToSave`) and the data you add directly to `this` (`this.whatIWantedToSave`) can be accessed via `this`. But only the data added directly to `this` will be saved in a saved game (e.g. `this.myVar` will be saved but `Trigger.protoype.myVar` not!). So although it's possible to add other stuff to the prototype than just functions, it shouldn't change throughout the game. Also note that functions can't be saved in saved games. So in short, functions should always be defined under the prototype, and never change.105 '''Note:''' both the `Trigger` prototype (e.g. `Trigger.prototype.myData`) and the data you add directly to `this` (`this.myData`) can be accessed via `this`. But only the data added directly to `this` will be saved in a saved game (e.g. `this.myVar` will be saved but `Trigger.protoype.myVar` not!). So although it's possible to add other stuff to the prototype than just functions, it shouldn't change throughout the game. Also note that functions can't be saved in saved games. So in short, functions should always be defined under the prototype, and never change. 106 106 107 107 == Registering triggers ==