- Home /
 
editor target cast fail on DLL
Editor.target cast works fine on the unity project, but on my external library dont. Am I missing some assembly reference?
 using UnityEngine;
 using UnityEngine.UI;
 using UnityEditor;
 using UnityEditor.UI;
 
 namespace HiddenClasses {
 
     [CustomEditor(typeof(DropdownExpand), true), CanEditMultipleObjects]
     public class DropdownExpandEditor : DropdownEditor {
         private SerializedProperty maxItens;
 
         protected override void OnEnable() {
             base.OnEnable();
             maxItens = serializedObject.FindProperty("maxItens");
         }
 
         public override void OnInspectorGUI() {
             serializedObject.Update();
             var maxi = maxItens.intValue;
             
             MonoBehaviour b;
 
             var num = (target as DropdownExpand).options.Count;
             var size = (serializedObject.targetObject as DropdownExpand).itemText.transform.parent
                 .GetComponent<RectTransform>().rect.height;
 
             EditorGUILayout.LabelField("Itens: {0}    Size: {1}    Max Size: {2}".V(num, size, (maxi > 0 ? maxi : num) * size));
             EditorGUILayout.PropertyField(maxItens);
             serializedObject.ApplyModifiedProperties();
             EditorGUILayout.Space();
             //base.OnInspectorGUI();
         }
     }
 }  
 
               Note the error says MonoBehavior doesnt exists but, a variable of that type is declared just a line before (for testing purpose) 
 
                 
                cast-error.png 
                (42.8 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Color custom editor window ? 2 Answers
Unity editor and inspector header 0 Answers