Code: Select all
private void OnValidate()
{
if (line == null)
line = GetComponent();
if (!Mathf.Approximately(changeBothRadius, previousChangeBothRadius))
{
xradius = changeBothRadius;
yradius = changeBothRadius;
previousChangeBothRadius = changeBothRadius;
}
ConfigureLineRenderer();
CreatePoints();
if (Application.isPlaying || UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)
return;
if (numOfObjects != previousNumOfObjects)
{
previousNumOfObjects = numOfObjects;
UnityEditor.EditorApplication.delayCall += () =>
{
ClearObjects();
EnsureObjects();
};
}
UpdateDebugText();
}