Add unbinds to scn
This commit is contained in:
parent
0810ecaafd
commit
7780b40a3a
2 changed files with 6 additions and 2 deletions
|
@ -104,7 +104,7 @@
|
|||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ "conn_count": 0, "conns": PackedInt32Array(), "editable_instances": [], "names": PackedStringArray(), "node_count": 0, "node_paths": [], "nodes": PackedInt32Array(), "variants": [], "version": 2 }">
|
||||
<member name="_bundled" type="Dictionary" setter="_set_bundled_scene" getter="_get_bundled_scene" default="{ "conn_count": 0, "conns": PackedInt32Array(), "editable_instances": [], "names": PackedStringArray(), "node_count": 0, "node_paths": [], "nodes": PackedInt32Array(), "variants": [], "version": 3 }">
|
||||
A dictionary representation of the scene contents.
|
||||
Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene.
|
||||
</member>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "scene/main/missing_node.h"
|
||||
#include "scene/property_utils.h"
|
||||
|
||||
#define PACKED_SCENE_VERSION 2
|
||||
#define PACKED_SCENE_VERSION 3
|
||||
#define META_POINTER_PROPERTY_BASE "metadata/_editor_prop_ptr_"
|
||||
bool SceneState::can_instantiate() const {
|
||||
return nodes.size() > 0;
|
||||
|
@ -1294,6 +1294,9 @@ void SceneState::set_bundled_scene(const Dictionary &p_dictionary) {
|
|||
for (int j = 0; j < cd.binds.size(); j++) {
|
||||
cd.binds.write[j] = r[idx++];
|
||||
}
|
||||
if (version >= 3) {
|
||||
cd.unbinds = r[idx++];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1380,6 +1383,7 @@ Dictionary SceneState::get_bundled_scene() const {
|
|||
for (int j = 0; j < cd.binds.size(); j++) {
|
||||
rconns.push_back(cd.binds[j]);
|
||||
}
|
||||
rconns.push_back(cd.unbinds);
|
||||
}
|
||||
|
||||
d["conns"] = rconns;
|
||||
|
|
Loading…
Reference in a new issue