Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

event type is obsolete

Discussion in 'Scripting' started by peterbrinson, Dec 20, 2017.

  1. peterbrinson

    peterbrinson

    Joined:
    Jul 1, 2013
    Posts:
    63
    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?

    Code (csharp):
    1. if (e.type == EventType.repaint)
    Code (csharp):
    1. if (e.type == EventType.mouseDown)
    Code (csharp):
    1. if (e.type == EventType.keyDown)
    -ty
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    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
     
    sawthinkar, brayan1232 and karl_jones like this.
  3. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Maybe a leftover from the "unity script" times where they tried to maintain the lowerCamelCase naming scheme for enums.
     
  4. peterbrinson

    peterbrinson

    Joined:
    Jul 1, 2013
    Posts:
    63
    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.
     
  5. Janibasha

    Janibasha

    Joined:
    Mar 7, 2017
    Posts:
    8
    error CS0619: `UnityEngine.EventType.repaint' is obsolete: `Use Repaint instead (UnityUpgradable) -> Repaint'
    clearly says
    1. if (e.type == EventType.repaint) change to if (e.type == EventType.Repaint) Capital R in repaint
    1. if (e.type == EventType.mouseDown) change to if (e.type == EventType.MouseDown)
    1. if (e.type == EventType.keyDown) change to if (e.type == EventType.KeyDown)
     
    TimeliO, ahsanar, fripadao and 8 others like this.
  6. FormalSnake

    FormalSnake

    Joined:
    Oct 26, 2019
    Posts:
    12
    It doesn't find any of that scripts in curveeditor.cs
     
  7. paddywong

    paddywong

    Joined:
    Apr 5, 2020
    Posts:
    1
    you are a genius!!!!!!!!!!!!!!!!!!!!!
     
  8. darkdoom973

    darkdoom973

    Joined:
    Jul 21, 2020
    Posts:
    13
    Thanks, this worked, I tried just using Repaint and not EventType.Repaint