Search Unity

Fix for "Input string was not in a correct format." in ProGrids 2.5.0f0

Discussion in 'World Building' started by ForMiSoft, Nov 26, 2018.

  1. ForMiSoft

    ForMiSoft

    Joined:
    Dec 5, 2016
    Posts:
    8
    There is one unhandled exception in the file Assets\ProCore\ProGrids\Classes\pg_Util.cs.

    To fix it, change these lines in method ColorWithString:

    return new Color(
    float.Parse(rgba[0]),
    float.Parse(rgba[1]),
    float.Parse(rgba[2]),
    float.Parse(rgba[3]));

    to this:

    try {
    return new Color(
    float.Parse(rgba[0]),
    float.Parse(rgba[1]),
    float.Parse(rgba[2]),
    float.Parse(rgba[3]));
    } catch {
    return new Color(1f, 0f, 1f, 1f);
    }