Skip to content

Commit

Permalink
Revert "Revert "Revert "[FIX] Don't initialize script component multi…
Browse files Browse the repository at this point in the history
…ple times"""

This reverts commit ed444a1.
  • Loading branch information
vkalpias committed Jul 30, 2015
1 parent 0ddd6af commit 190bcf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/framework/components/script/script_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ pc.extend(pc, function () {
this.system._destroyScriptComponent(this);

this.data.areScriptsLoaded = false;
this.data.initialized = false;
this.data.postInitialized = false;

// get the urls
var scripts = newValue;
Expand Down
4 changes: 2 additions & 2 deletions src/framework/components/script/script_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ pc.extend(pc, function () {
this._registerInstances(root);

if (root.enabled) {
if (root.script && root.script.enabled && !root.script.data.initialized) {
if (root.script && root.script.enabled) {
this._initializeScriptComponent(root.script);
}

Expand All @@ -136,7 +136,7 @@ pc.extend(pc, function () {
*/
onPostInitialize: function (root) {
if (root.enabled) {
if (root.script && root.script.enabled && !root.script.data.postInitialized) {
if (root.script && root.script.enabled) {
this._postInitializeScriptComponent(root.script);
}

Expand Down

0 comments on commit 190bcf6

Please sign in to comment.