playMaker

Author Topic: Unity 4.5 and Tooltip Attribute  (Read 18146 times)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Unity 4.5 and Tooltip Attribute
« 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.
« Last Edit: May 28, 2014, 10:53:07 AM by Alex Chouls »

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Unity 4.5 and Tooltip Attribute
« Reply #1 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.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unity 4.5 and Tooltip Attribute
« Reply #2 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
  {
   ...
   }
}

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Unity 4.5 and Tooltip Attribute
« Reply #3 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

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Unity 4.5 and Tooltip Attribute
« Reply #4 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

any tips on fixing these?

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

« Last Edit: June 18, 2014, 10:50:06 AM by terri »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unity 4.5 and Tooltip Attribute
« Reply #5 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.

jwvanderbeck

  • Playmaker Newbie
  • *
  • Posts: 18
Re: Unity 4.5 and Tooltip Attribute
« Reply #6 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.