mirror of
https://github.com/godotengine/godot
synced 2024-10-14 19:47:56 +00:00
Merge pull request #52605 from TokageItLab/fixed-vtype-in-node-oneshot
Fixed value type and applied small change in `AnimationNodeOneShot`
This commit is contained in:
commit
be63fdff80
|
@ -248,27 +248,26 @@ double AnimationNodeOneShot::process(double p_time, bool p_seek) {
|
||||||
if (fade_in > 0) {
|
if (fade_in > 0) {
|
||||||
blend = time / fade_in;
|
blend = time / fade_in;
|
||||||
} else {
|
} else {
|
||||||
blend = 0; //wtf
|
blend = 0;
|
||||||
}
|
}
|
||||||
|
} else if (!do_start && remaining <= fade_out) {
|
||||||
} else if (!do_start && remaining < fade_out) {
|
if (fade_out > 0) {
|
||||||
if (fade_out) {
|
|
||||||
blend = (remaining / fade_out);
|
blend = (remaining / fade_out);
|
||||||
} else {
|
} else {
|
||||||
blend = 1.0;
|
blend = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
blend = 1.0;
|
blend = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float main_rem;
|
double main_rem;
|
||||||
if (mix == MIX_MODE_ADD) {
|
if (mix == MIX_MODE_ADD) {
|
||||||
main_rem = blend_input(0, p_time, p_seek, 1.0, FILTER_IGNORE, !sync);
|
main_rem = blend_input(0, p_time, p_seek, 1.0, FILTER_IGNORE, !sync);
|
||||||
} else {
|
} else {
|
||||||
main_rem = blend_input(0, p_time, p_seek, 1.0 - blend, FILTER_BLEND, !sync);
|
main_rem = blend_input(0, p_time, p_seek, 1.0 - blend, FILTER_BLEND, !sync);
|
||||||
}
|
}
|
||||||
|
|
||||||
float os_rem = blend_input(1, os_seek ? time : p_time, os_seek, blend, FILTER_PASS, false);
|
double os_rem = blend_input(1, os_seek ? time : p_time, os_seek, blend, FILTER_PASS, false);
|
||||||
|
|
||||||
if (do_start) {
|
if (do_start) {
|
||||||
remaining = os_rem;
|
remaining = os_rem;
|
||||||
|
|
Loading…
Reference in a new issue