Hello,
I would like to know how to acces a class in component (a non monobehaviour class) through a Custom Editor script.
For example I have these:
HouseScript.cs
using UnityEngine;
using System.Collections;
public class HouseScript: MonoBehaviour
{
public Door door = new Door();
}
HouseScriptEditor.cs
using UnityEngine;
using System.Collections;
using System;
using UnityEditor;
[CustomEditor(typeof(HouseScript))]
public class HouseScriptEditor : Editor
{
SerializedProperty eDoor;
void OnEnable()
{
serializedObject = new SerializedObject (target);
}
public override void OnInspectorGUI()
{
serializedObject.Update();
serializedObject.ApplyModifiedProperties();
base.OnInspectorGUI();
}
}
Door.cs
public class Door
{
public int someInt;
}
So my question would be, how can I access “someInt” in my Door.cs class?
This might be a stupid question to someone with experience, but this is what I lack from, experience on custom editor scripting.
Thank you for your time