i believe this has to do with something in AC, if im reading the guidelines correctly, but here is my situation:
I have a light(as in a sprite of a light) in the scene(2d game mode), that has an animation attached to it that is making it flicker on an off. The goal is to have a tick sound play everytime it turns on and off, as per the key frames in the animation tab. I was able to do this by adding the AC sound component, inserting the clip, and then in the animation, ad am "event" that triggers "Play()". and it works when i test it, but the animation tab becomes broken. It's just all grey and the console displays this:
AmbiguousMatchException: Ambiguous matching in method resolution
System.Reflection.Binder.FindMostDerivedMatch (System.Reflection.MethodBase[] match) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Binder.cs:106)
System.MonoType.GetMethodImpl (System.String name, BindingFlags bindingAttr, System.Reflection.Binder binder, CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/MonoType.cs:245)
System.Type.GetMethod (System.String name, BindingFlags bindingAttr) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Type.cs:787)
UnityEditor.AnimationEventPopup.FormatEvent (UnityEngine.GameObject root, UnityEngine.AnimationEvent evt) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationEventPopup.cs:160)
UnityEditor.AnimationEventTimeLine.EventLineGUI (Rect rect, UnityEditorInternal.AnimationWindowState state) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/Deprecated/AnimationEventTimeline.cs:146)
UnityEditor.AnimEditor.EventLineOnGUI () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:311)
UnityEditor.AnimEditor.OnBreadcrumbGUI (UnityEditor.EditorWindow parent, Rect position) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimEditor.cs:112)
UnityEditor.AnimationWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindow.cs:47)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
I've found threads elsewhere with similar issues but none of them say where to fix it, and was hoping maybe its something in AC that i can change to fix it.. any ideas? thanks!
Comments
When you say it works when you test it, do you mean it works when you play the game? If that's the case, and the Animation window breaks, then it could be that Sound's Play() function is being run outside of the game running. I could be wrong, but I believe that would be a Unity issue.
You should be able to get around it by instead calling a function of your own on a custom script, and have that function run Sound.Play() only when the game itself is running.
http://forum.unity3d.com/threads/ambiguousmatchexception-ambiguous-matching-in-method-resolution.119367/