Improve documentation for get_animation()
This commit is contained in:
parent
c08e84af0d
commit
385a5b44aa
@ -22,7 +22,7 @@
|
|||||||
<return type="Animation" />
|
<return type="Animation" />
|
||||||
<param index="0" name="name" type="StringName" />
|
<param index="0" name="name" type="StringName" />
|
||||||
<description>
|
<description>
|
||||||
Returns the [Animation] with the key [param name], or [code]null[/code] if none is found.
|
Returns the [Animation] with the key [param name]. If the animation does not exist, [code]null[/code] is returned and an error is logged.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_animation_list" qualifiers="const">
|
<method name="get_animation_list" qualifiers="const">
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
<return type="Animation" />
|
<return type="Animation" />
|
||||||
<param index="0" name="name" type="StringName" />
|
<param index="0" name="name" type="StringName" />
|
||||||
<description>
|
<description>
|
||||||
Returns the [Animation] with key [param name] or [code]null[/code] if not found.
|
Returns the [Animation] with the key [param name]. If the animation does not exist, [code]null[/code] is returned and an error is logged.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_animation_library" qualifiers="const">
|
<method name="get_animation_library" qualifiers="const">
|
||||||
|
@ -1501,7 +1501,7 @@ bool AnimationPlayer::has_animation(const StringName &p_name) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ref<Animation> AnimationPlayer::get_animation(const StringName &p_name) const {
|
Ref<Animation> AnimationPlayer::get_animation(const StringName &p_name) const {
|
||||||
ERR_FAIL_COND_V_MSG(!animation_set.has(p_name), Ref<Animation>(), vformat("Animation not found: %s.", p_name));
|
ERR_FAIL_COND_V_MSG(!animation_set.has(p_name), Ref<Animation>(), vformat("Animation not found: \"%s\".", p_name));
|
||||||
|
|
||||||
const AnimationData &data = animation_set[p_name];
|
const AnimationData &data = animation_set[p_name];
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ bool AnimationLibrary::has_animation(const StringName &p_name) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ref<Animation> AnimationLibrary::get_animation(const StringName &p_name) const {
|
Ref<Animation> AnimationLibrary::get_animation(const StringName &p_name) const {
|
||||||
ERR_FAIL_COND_V(!animations.has(p_name), Ref<Animation>());
|
ERR_FAIL_COND_V_MSG(!animations.has(p_name), Ref<Animation>(), vformat("Animation not found: \"%s\".", p_name));
|
||||||
|
|
||||||
return animations[p_name];
|
return animations[p_name];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user