Merge pull request #51086 from aaronfranke/3.x-warn-dectime
This commit is contained in:
commit
db0370cab5
3 changed files with 3 additions and 0 deletions
|
@ -91,6 +91,7 @@ int Math::range_step_decimals(double p_step) {
|
|||
}
|
||||
|
||||
double Math::dectime(double p_value, double p_amount, double p_step) {
|
||||
WARN_DEPRECATED_MSG("The `dectime()` function has been deprecated and will be removed in Godot 4.0. Use `move_toward()` instead.");
|
||||
double sgn = p_value < 0 ? -1.0 : 1.0;
|
||||
double val = Math::abs(p_value);
|
||||
val -= p_amount * p_step;
|
||||
|
|
|
@ -224,6 +224,7 @@
|
|||
<argument index="1" name="amount" type="float" />
|
||||
<argument index="2" name="step" type="float" />
|
||||
<description>
|
||||
[b]Note:[/b] [code]dectime[/code] has been deprecated and will be removed in Godot 4.0, please use [method move_toward] instead.
|
||||
Returns the result of [code]value[/code] decreased by [code]step[/code] * [code]amount[/code].
|
||||
[codeblock]
|
||||
a = dectime(60, 10, 0.1)) # a is 59.0
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace Godot
|
|||
/// </param>
|
||||
/// <param name="step">Times the <paramref name="value"/> will be decreased by <paramref name="amount"/></param>
|
||||
/// <returns>The decreased value.</returns>
|
||||
[Obsolete("DecTime has been deprecated and will be removed in Godot 4.0, use Mathf.MoveToward instead.")]
|
||||
public static real_t DecTime(real_t value, real_t amount, real_t step)
|
||||
{
|
||||
real_t sgn = Mathf.Sign(value);
|
||||
|
|
Loading…
Reference in a new issue