Hi All,
I have two scripts, one which displays the user properties in a custom inspector editor and another manages the properties - however these values are not displayed to the user. I’ve drawn up a simple version of my current setup below. I’m trying to the properties not shown to the user animatable on the timeline via the sliders which are shown to the user. However I can’t seem to get them to keyframe. Any ideas or tips to why it isn’t working? - In the example below- I want to animate selectedCategory on the timeline when the user changes the slider position.
Custom Inspector Editor:
[CustomEditor(typeof(LightingObjectControl))]
public class GDTF_LightingControlInspectorEditor : Editor
{
private LightingObjectControl lightingObjectControlTarget;
lightingObjectControlTarget.categoriesHolder.selectedCategory = (int) GUILayout.HorizontalSlider(lightingObjectControlTarget.categoriesHolder.selectedCategory, 0, 100);
}
Script To Manage Values:
[Serializable]
public class LightingObjectControl : MonoBehaviour
{
// Editor Window Variables
public CategoryHolder categoriesHolder;
[Button("GenerateCategory")] //Button is part of ODIN.
public void genCat(){
CategoryHolder categoriesHolder = new CategoryHolder();
categoriesHolder = 0;
}
[Serializable]
public struct CategoryHolder
{
public Category[] Categories;
public int selectedCategory;
}
}