Search Unity

Bug 2020.3.14f1c1 & 2020.3.3f1 DelayedFloatField cannot handle special float values

Discussion in 'Editor & General Support' started by cuiyinqiu, Oct 8, 2021.

  1. cuiyinqiu

    cuiyinqiu

    Joined:
    Aug 31, 2020
    Posts:
    1
    In 2020.3.14f1c1, DelayedFloatField and DelayedDoubleField don't recognize special strings, such as "inf", "infinity", "-inf", "-infinity", "nan", which are handled properly by both FloatField and DoubleField. After looking at the source code of 2020.3.3f1, I find the bugs are present in this early version and guess they are caused by errors made in
    internal static bool StringToDouble(string str, out double value)
    where the return value is not set to true when str represents special values. However, considering that both the delayed and the non-delayed versions use this potentially buggy function, the fact that the non-delayed versions are working as expected probably worth further investigation.