Hello Guest

Author Topic: tk2dbutton in tk2dButton.cs does not send function's argument  (Read 4129 times)

hachibei

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 12
    • View Profile
tk2dbutton in tk2dButton.cs does not send function's argument
« on: December 26, 2012, 07:23:03 pm »
Firstly, happy holidays unikron! (well you seems active in the forum ;D).

Now I do not know if this already noted, but the latest tk2dButton.cs does not send argument as part of the message:

Code: [Select]
// line 328 in tk2dButton.cs
if (targetObject)
{
targetObject.SendMessage(messageName);
}

Unity implementation of SendMessage:
Code: [Select]
function SendMessage (methodName : String, value : object = null, options : SendMessageOptions = SendMessageOptions.RequireReceiver) : void
Source: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.SendMessage.html:


I do have a message handler of my own so this here is just a heads up for unikron (unless he already fixed it for the next version of course 8)).

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: tk2dbutton in tk2dButton.cs does not send function's argument
« Reply #1 on: December 27, 2012, 06:30:47 am »
Unfortunately it isn't possible to change it without breaking backwards compatibility. Unity expects a function signature with a parameter if the event is called with a parameter. I'll change it in tk2d 2.0