playMaker

Author Topic: Namespaced actions with duplicate class names error action list  (Read 2585 times)

Krileon

  • Full Member
  • ***
  • Posts: 107
Namespaced actions with duplicate class names error action list
« on: December 23, 2013, 06:06:00 PM »
If you namespace your actions (e.g. namespace HutongGames.PlayMaker.Actions.Anim) then use a class like "Play" and have another action that is also namespaced "namespace HutongGames.PlayMaker.Actions.AudioToolkit" which uses a class of "Play" it causes the below error when trying to use the Action Browser. It's using the class name as the key for a dictionary, but this doesn't seam to be the correct approach as it's not considering the namespace. The end result is I have to name my actions stupidly (e.g. AnimPlay, AudioToolkitPlay) for them to not conflict even though they already won't because they have a unique namespace. Can a new method be implemented to build the list to avoid this issue?

Code: [Select]
ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.Type,UnityEngine.Object].Add (System.Type key, UnityEngine.Object value) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
HutongGames.PlayMakerEditor.FsmEditorUtility.BuildActionScriptLookup ()
HutongGames.PlayMakerEditor.FsmEditorUtility.BuildActionsList ()
HutongGames.PlayMakerEditor.ActionSelector.Initialize ()
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
« Last Edit: December 23, 2013, 06:09:29 PM by Krileon »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Namespaced actions with duplicate class names error action list
« Reply #1 on: December 23, 2013, 09:25:12 PM »
It looks like the problem happens when building the lookups for the Edit Script function. Basically their are name collisions in the Monoscript name property, which doesn't seem to use namespaces. There should be a workaround...

Can you submit a bug report so we can track this issue. Thanks!

Krileon

  • Full Member
  • ***
  • Posts: 107
Re: Namespaced actions with duplicate class names error action list
« Reply #2 on: December 23, 2013, 10:14:42 PM »
How do I submit a bug report? O.o

Edit: Nevermind. I feel stupid. It's stickied, lol.