Refactor some object type checking code with cast_to

Less stringly typed logic, and less String allocations and comparisons.
This commit is contained in:
Rémi Verschelde 2022-02-06 14:12:19 +01:00
parent 0154ce2c8d
commit 317cd0b19a
No known key found for this signature in database
GPG key ID: C3336907360768E1
29 changed files with 140 additions and 171 deletions

View file

@ -300,7 +300,7 @@ void AnimationNodeBlendTreeEditor::_add_node(int p_idx) {
base_name = add_options[p_idx].name;
} else {
ERR_FAIL_COND(add_options[p_idx].script.is_null());
String base_type = add_options[p_idx].script->get_instance_base_type();
StringName base_type = add_options[p_idx].script->get_instance_base_type();
AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instantiate(base_type));
ERR_FAIL_COND(!an);
anode = Ref<AnimationNode>(an);