Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Alex Chouls on May 27, 2014, 01:56:22 PM

Title: Unity 4.5 and Tooltip Attribute
Post by: Alex Chouls on May 27, 2014, 01:56:22 PM
Unity 4.5 defines a new Tooltip attribute that can conflict with Playmaker's Tooltip attribute.

All built in actions use the HutongGames.PlayMaker.Actions namespace, so they find the correct Tooltip attribute.

Third party actions that use their own namespaces will need to point to the correct Tooltip.

For example, you can add this to your using statements:
using Tooltip = HutongGames.PlayMaker.TooltipAttribute;

NOTE: If you change an action's namespace it will look like a new action to Playmaker and parameters will be reset. So "using Tooltip..." is a better solution for existing action, while "namespace HutongGames.PlayMaker.Actions" should be used for new actions.
Title: Re: Unity 4.5 and Tooltip Attribute
Post by: terri on June 16, 2014, 05:31:43 PM
Hi, I'm having some trouble with this, where exactly should I be adding the line "using Tooltip = HutongGames.PlayMaker.TooltipAttribute;"?

I tried adding that to one the problematic actions but that just shut down Playmaker as a whole.
Title: Re: Unity 4.5 and Tooltip Attribute
Post by: Alex Chouls on June 16, 2014, 05:45:17 PM
Put it at the top of your file with other using statements:

using UnityEngine;
using Tooltip = HutongGames.PlayMaker.TooltipAttribute;

namespace MyNamespace
{
   public class MyAction: FsmStateAction
  {
   ...
   }
}
Title: Re: Unity 4.5 and Tooltip Attribute
Post by: terri on June 17, 2014, 09:07:41 AM
Put it at the top of your file with other using statements:

using UnityEngine;
using Tooltip = HutongGames.PlayMaker.TooltipAttribute;

namespace MyNamespace
{
   public class MyAction: FsmStateAction
  {
   ...
   }
}

of course, thanks!
now let me get this astar fixed
Title: Re: Unity 4.5 and Tooltip Attribute
Post by: terri on June 18, 2014, 09:03:07 AM
hey, I noticed that my problem was that some actions seem to be structured differently. it seems like these instructions work well for .cs actions, but for .js its giving me errors

this is what the A* actions look like:
https://dl.dropboxusercontent.com/u/226993/pm_error2.png (https://dl.dropboxusercontent.com/u/226993/pm_error2.png)

any tips on fixing these?

EDIT: I ended up working around it by just removing the tooltip references

Title: Re: Unity 4.5 and Tooltip Attribute
Post by: Alex Chouls on June 21, 2014, 09:20:27 PM
Unity script uses "import" instead of "using." You could try substituting "import" for "using" in the tooltip alias, but I'm not sure offhand if unity script supports aliasing of types...

If it doesn't you can change "Tooltip" to "HutongGames.PlayMaker.Tooltip" wherever it's used in the js file.
Title: Re: Unity 4.5 and Tooltip Attribute
Post by: jwvanderbeck on December 12, 2014, 11:56:16 PM
FYI I just discovered that the built in Custom Action Wizard generates broken code after this change.  You have to manually add the using statement.