Skip to content

Commit

Permalink
Fixes dropping script node to an scene.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhaserEditor2D committed Jun 26, 2023
1 parent 3054bf5 commit 0b9a65e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ namespace phasereditor2d.scene.ui.editor.undo {
|| asset instanceof sceneobjects.ScriptNodeExtension;
}

if (isScriptNode) {
const sel = editor.getSelectedGameObjects();

// We are droping a script node,
if (isScriptNode && sel.length > 0) {

// We are dropping a script node,
// so we should go for every object selected in the scene
// and add the script.
// It is different from adding a regular game object,
// where only one instance is created

const sel = editor.getSelectedGameObjects();

const newSprites = [];

const script = this._data[0];
Expand Down

0 comments on commit 0b9a65e

Please sign in to comment.