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. Dismiss Notice

Editor window with a graph

Discussion in 'Scripting' started by Censureret, Feb 12, 2021.

  1. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    360
    Hello everyone I am trying to make an editor window with a few input fields that would result in a graph however I am not quite sure how to draw a graph inside a custom window

    Just for the record, the AnimCurve graph won't work for me I would need a real plotted graph.

    Can anyone help me out? :D
     
  2. diXime

    diXime

    Joined:
    Oct 2, 2018
    Posts:
    162
  3. Censureret

    Censureret

    Joined:
    Jan 3, 2017
    Posts:
    360
    Thank you for you response but i am looking for something that is not an animation curve maybe a "field" where i can draw the graph my self?
     
  4. diXime

    diXime

    Joined:
    Oct 2, 2018
    Posts:
    162
    I understand you well, don't mind the name, you can use it as you like, not only for animations. You can get the values with the method Evaluate. The CurveField is indeed a field, and it lets you modify the curve.
    As someone with a background in mathematics, I really wonder what you are trying to achieve by drawing yourself a plotted graph in editor. You can add points with you mouse or parametrically, so it should do whatever you like anyway.

    I've found someone asking for something similar, about drawing in inspector, with quite an advanced answer, if you want to look into it.