diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 17:48:03 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-12-08 17:48:03 -0300 |
commit | c650d4e19c1f1fffc2f798db3d18a1ad1a58ab8b (patch) | |
tree | 4b9280503112055e2431344547001db59702e69c /scene/3d/spatial.cpp | |
parent | 09ff4571859b012b64876883e186bb7dfaca0c8c (diff) | |
parent | e176bb6a7c736e8f2fe7fb96f2a4ecbb296dced0 (diff) |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'scene/3d/spatial.cpp')
-rw-r--r-- | scene/3d/spatial.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index a65f68ed2c..7d48420a83 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -594,6 +594,15 @@ bool Spatial::is_hidden() const{ return !data.visible; } +void Spatial::set_hidden(bool p_hidden) { + + if (data.visible != p_hidden) { + return; + } + + _set_visible_(!p_hidden); +} + void Spatial::_set_visible_(bool p_visible) { if (p_visible) @@ -742,6 +751,7 @@ void Spatial::_bind_methods() { ObjectTypeDB::bind_method(_MD("hide"), &Spatial::hide); ObjectTypeDB::bind_method(_MD("is_visible"), &Spatial::is_visible); ObjectTypeDB::bind_method(_MD("is_hidden"), &Spatial::is_hidden); + ObjectTypeDB::bind_method(_MD("set_hidden","hidden"), &Spatial::set_hidden); ObjectTypeDB::bind_method(_MD("_set_visible_"), &Spatial::_set_visible_); ObjectTypeDB::bind_method(_MD("_is_visible_"), &Spatial::_is_visible_); |