I can’t get ExecuteInEditMode to work correctly. I want Update to run on a script component in the editor so I do like this:
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class jb_VisualRepData : MonoBehaviour
{
public jb_VisualRep visualRep;
public string groundMaterial;
public float[] lodDistances;
///////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////
void Update()
{
if (Application.isEditor visualRep != null)
{
visualRep.Update();
if (lodDistances != null)
{
for (int i = 0; i < lodDistances.Length i < visualRep.Lods.Count; ++i)
{
visualRep.Lods[i].SetDistance(lodDistances[i]);
}
}
}
}
}
But the update function only executes once. I’m using this script to update my lods when in the editor.
Thanks,
//ohm