event type is obsolete

After upgrading to 2017.3, I get 5 errors that look something like this:

Assets/PostProcessing/Editor/Utils/CurveEditor.cs(379,45): error CS0619: UnityEngine.EventType.repaint' is obsolete: Use Repaint instead (UnityUpgradable) → Repaint’

OR

Assets/PostProcessing/Editor/Utils/CurveEditor.cs(425,45): error CS0619: UnityEngine.EventType.mouseDown' is obsolete: Use MouseDown instead (UnityUpgradable) → MouseDown’

You’d think this feedback would be plenty helpful, but I can’t figure it out. What do I change these to?

if (e.type == EventType.repaint)
if (e.type == EventType.mouseDown)
if (e.type == EventType.keyDown)

-ty

It told you exactly what to do:

MouseDown, not mouseDown. (It’s been MouseDown since forever and mouseDown isn’t in any docs so it’s bizarre that it ever worked…maybe in Unity 2?)

–Eric

3 Likes

Maybe a leftover from the “unity script” times where they tried to maintain the lowerCamelCase naming scheme for enums.

Yes, one is clearly from a 3rd party and the other is in a “PostProcessing” folder, which I believe is the free Post Processing stack available on the asset store, from Unity. I believe.

error CS0619: UnityEngine.EventType.repaint' is obsolete: Use Repaint instead (UnityUpgradable) → Repaint’
clearly says

  • if (e.type == EventType.repaint) change to if (e.type == EventType.Repaint) Capital R in repaint

  • if (e.type == EventType.mouseDown) change to if (e.type == EventType.MouseDown)

  • if (e.type == EventType.keyDown) change to if (e.type == EventType.KeyDown)

11 Likes

It doesn’t find any of that scripts in curveeditor.cs

you are a genius!!!

Thanks, this worked, I tried just using Repaint and not EventType.Repaint