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
  Getting reference to Generator and InputSplinePath Spline velikizlivuk 3 9 08-15-2023, 11:08 PM
Last Post: velikizlivuk
  Error when trying to connect nodes in prefab edit mode Lupos 4 9 06-02-2023, 10:27 AM
Last Post: _Aka_
  Error when switching splines ricke 3 7 10-10-2022, 08:46 AM
Last Post: _Aka_
  Error when recreating splines / connections jh092 3 7 07-25-2022, 09:58 AM
Last Post: _Aka_

Forum Jump: