- Home /
Custom curve editor in the Inspector (Like in LineRenderer)
Can i add exactly the same field to edit the curve like they made for LineRenderer component to my CustomEditor script. Please do not recommend me the animation curve, i'm aware of it. Thanks.
Assembly reference of the line renderer says it is AnimationCurve what are you looking at. /// /// <para>Set the curve describing the width of the line at various points along its length.</para> /// public AnimationCurve widthCurve { get; set; }
Yes, obviously! But i'm looking for a way to build that particular EditorGUILayout if any. There is a difference from AnimationCurve layout.
Answer by Bunny83 · Jul 02, 2018 at 12:27 AM
No, you can't simply use that editor because it's an internal class. The linerenderer editor uses the LineRendererCurveEditor which is an internal class. It will in turn also use the CurveEditor class which is also an internal class.
Note that this repository may only be used for reference. You are not allowed to copy or distribute any of the source code found in this repository. Make sure you read the license and copyright information on the main page.
Answer by Moritonal · Apr 11, 2020 at 11:59 PM
You can use the CurveField custom GUI element to edit curves in the editor similar to the LineRenderer.
Uhm, have you read the bold text in the question? He didn't want to use AnimationCurves ^^. He also made that clear once again in the comments below his question
Uhm, this question is first on Google for "Custom Curve Editor". Existing answers made a custom curve editor sound impossible when it's very possible. Shockingly I wasn't trying to answer the two year old question, just adding some new info.
Your answer
Follow this Question
Related Questions
Change texture import settings by script 0 Answers
Why is Editor not persisting programmatic changes even when using EditorUtility.SetDirty() 1 Answer
Custom Editor Access to Scene Objects Variables (in the same way as UnityEvents) 1 Answer
Custom editor script for folders? 1 Answer
How can i get SerializedProperty from UnityEvent which in List. Sorry for my Eng. 2 Answers