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

How do I use a graph in the editor as a variable

Discussion in 'Editor & General Support' started by steef_qwp, Apr 9, 2021.

  1. steef_qwp

    steef_qwp

    Joined:
    Mar 20, 2020
    Posts:
    4
  2. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    The linerenderer has some custome code for displaying the curve data.
    https://github.com/Unity-Technologi...tor/Mono/Inspector/LineRendererEditor.cs#L129

    and the code it uses there is
    https://github.com/Unity-Technologi...tor/Mono/Inspector/LineRendererCurveEditor.cs

    if you want to try to use it you will need to create a custome inscpector/ editor script for your class.

    If you need some basic curve editing take a look at animation curves.
    they bring a similar feature with it.
    https://docs.unity3d.com/ScriptReference/AnimationCurve.html
     
  3. steef_qwp

    steef_qwp

    Joined:
    Mar 20, 2020
    Posts:
    4
    Thanks, I'll take a look at it tomorrow!