Hi! First post as I just started with Unity. This message is on the console every time I start up Unity:
Assets\PostProcessing\Editor\PropertyDrawers\MinDrawer.cs(6,34): error CS0104: ‘MinAttribute’ is an ambiguous reference between ‘UnityEngine.PostProcessing.MinAttribute’ and ‘UnityEngine.MinAttribute’
Just started learning C# so I am baffled by this message.
Tried:
Reloaded Unity 2018.3.7 Personal
Upgraded Unity 2018.3.7 Personal to 2018.3.11f1 Personal
Updated Windows 7-64 bit to current updates
Many restarts/power on-offs over several days
Created new scene (no error)
Microsoft C# web site and manual for more error info
Program MiniDrawer Code:
using UnityEngine;
using UnityEngine.PostProcessing;
namespace UnityEditor.PostProcessing
{
[CustomPropertyDrawer(typeof(MinAttribute))]
sealed class MinDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
MinAttribute attribute = (MinAttribute)base.attribute;
if (property.propertyType == SerializedPropertyType.Integer)
{
int v = EditorGUI.IntField(position, label, property.intValue);
property.intValue = (int)Mathf.Max(v, attribute.min);
}
else if (property.propertyType == SerializedPropertyType.Float)
{
float v = EditorGUI.FloatField(position, label, property.floatValue);
property.floatValue = Mathf.Max(v, attribute.min);
}
else
{
EditorGUI.LabelField(position, label.text, “Use Min with float or int.”);
}
}
}
}
Can anyone help?
Thanks
Keith