I’m getting the error: “Cannot convert type UnityEngine.Object' to
Mask’”
when trying to cast Editor.target to my CustomEditor type. Why?
using UnityEngine;
using UnityEditor;
using System.Collections;
[UnityEditor.CustomEditor(typeof(Mask))]
public class MaskEditor : UnityEditor.Editor {
public override void OnInspectorGUI()
{
Mask mask = (Mask) target;
// ... Draw something with EditorGUILayout static methods ...
}
}
Mask is a simple class which doesn’t extends nothing and has a System.Serializable annotation.