public class Achievement
{
public string description;
public bool status;
}
public class AchievementsManager : MonoBehaviour
{
public Achievement achievements;
}
//////////////////////////////////////
[CustomEditor (typeof(AchievementsManager))]
public class AchievementsEditor : Editor
{ SerializedObject m_object;
SerializedProperty dataPath;
public void OnEnable ()
{
m_object = new SerializedObject(target);
dataPath = m_object.FindProperty("achievements");
}
public override void OnInspectorGUI ()
{
m_object.Update();
\\\\I want to display the descrption and status values of the achievement class. But it always returns null. But it is not null i have added values to it.\\\\\\\\\\\\\
SerializedProperty des = aDataPath.FindPropertyRelative("description");
SerializedProperty status = aDataPath.FindPropertyRelative("status");
EditorGUILayout.PropertyField(des);
EditorGUILayout.PropertyField(status);
}
}