public override float GetPropertyHeight(SerializedProperty property, GUIContent label) {

        float height = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
        BehaviourParamListSO projectileParams = property.objectReferenceValue as System.Object as BehaviourParamListSO;
        if (projectileParams != null) {
            parameters = projectileParams.parameters;
            height += parameters.Length * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
        }
        return height;
    }
Exemple #2
0
    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    {
        /*if (customProjectileBehaviour == null || customProjectileBehaviour.GetType() != customProjectileParams.behaviourType.FindType()) {
         *  customProjectileBehaviour = (AbstractProjectileBehaviourSO)ScriptableObject.CreateInstance(customProjectileParams.behaviourType.FindType());
         * }
         */

        float height = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;

        if (property.isExpanded)
        {
            height += (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) * 10;

            SerializedProperty paramProperty = property.FindPropertyRelative("customProjectileBehaviourParams");
            customProjectileParams = paramProperty.objectReferenceValue as System.Object as BehaviourParamListSO;
            if (customProjectileParams != null)
            {
                height += customProjectileParams.parameters.Length * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
            }
        }
        return(height);
    }