mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
make entity skeleton optional
This commit is contained in:
parent
1186011dcf
commit
9fff79f8e2
3 changed files with 26 additions and 17 deletions
|
|
@ -116,6 +116,10 @@ static int l_set_skeleton(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
if (lua::isnil(L, 2)) {
|
||||
entity->setRig(nullptr);
|
||||
return 0;
|
||||
}
|
||||
std::string skeletonName = lua::require_string(L, 2);
|
||||
auto rigConfig = assets->getShared<rigging::SkeletonConfig>(skeletonName);
|
||||
if (rigConfig == nullptr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue