Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'Ambiguous reference' error
#1
Hi there,

I made a project using an older version of Unity (probably 5.x) and then just tried to open it using Unity 2018.  I get the following errors:

Quote:Assets/Packages/DevTools/Editor/PropertyDrawers.cs(569,55): error CS0104: 'MinAttribute' is an ambiguous reference between 'FluffyUnderware.DevTools.MinAttribute' and 'UnityEngine.MinAttribute'

Assets/Packages/DevTools/Editor/PropertyDrawers.cs(568,34): error CS0104: 'MinAttribute' is an ambiguous reference between 'FluffyUnderware.DevTools.MinAttribute' and 'UnityEngine.MinAttribute'

I've also attached a screenshot.

I never got these before, and these two errors are preventing the code from compiling.  Can you please help me fix this?

Thank you!

   
Reply
#2
Hi,
Unity 2018.3 added a class with the same name than a Curvy class, thus creating the conflict. This was fixed in Curvy 4.1.0. So to fix this, just get the latest Curvy version.
If you don't want to get the latest version, whenever you will encounter the described error, replace in the code Min with DevTools.Min, and MinAttribute with DevTools.MinAttribute
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
I have the latest Curvy but still the same error
also unity 2018.3

do I only need to adjust the cs code in the MinDrawer.cs? or anywhere else?
Could you tell me where to change the code?
ps love Curvy (obvious without the bug)

in my code: MinDrawer.cs I have the following 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.");
}
}
}
}
Reply
#4
Hi,
There is no file called MinDrawer.cs in Curvy. It is maybe a file that existed in a very old version, and was removed/renamed since.
To fix your problem, remove your Curvy folders, and reinstall it. This is something you should do each time you update Curvy (and other assets in general) because when you import a Unity package (which is basically what happens when you update), the package only adds files, and can't remove existing files that are not necessary anymore.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Building error! am I something wrong? davide1104 2 1,129 01-10-2019, 10:27 PM
Last Post: _Aka_
  strange error pez111 5 2,875 12-23-2018, 04:34 PM
Last Post: _Aka_
  2018.1 is giving me the following error mythstified 4 2,841 05-08-2018, 03:32 PM
Last Post: _Aka_
  iOS non compile error hawken 7 4,187 02-15-2018, 03:11 PM
Last Post: _Aka_

Forum Jump: