Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - atfield

Pages: [1]
1
Support / why not release a water-marked free version.
« on: October 01, 2013, 08:55:16 am »
so the developer may sell source code made by toolkit 2d like ngui sth...
 8)

2
Support / Multi-touch problem with move and jump
« on: October 01, 2013, 08:26:24 am »
here my code
Code: [Select]
void Start () {
uiItem = gameObject.GetComponent<tk2dUIItem>();
    if(uiItem){
uiItem.OnDownUIItem += Downed;
uiItem.OnReleaseUIItem += Released;
}
}


void OnDisable(){
UnsubscribeEvent();
}

void OnDestroy(){
UnsubscribeEvent();
}

void UnsubscribeEvent(){
// uiItem.OnClickUIItem -= Clicked;
if(uiItem){
uiItem.OnDownUIItem -= Downed;
uiItem.OnReleaseUIItem -= Released;
}
}



void Downed(tk2dUIItem clickedUIItem)
{
switch(name){
case "btnMoveLeft":
Player.isMoveL = true;
break;
case "btnMoveRight":
Player.isMoveR = true;
break;
}
}
void Released(tk2dUIItem clickedUIItem)
{
switch(name){
case "btnMoveLeft":
Player.isMoveL = false;
break;
case "btnMoveRight":
Player.isMoveR = false;
break;
case "btnJump":
GameObject.Find("man").GetComponent<Player>().JumpButton(true);
break;
}
}

look,while the ismoveL or ismoveR is true ,the player should move on x axis.
Even if when jump.
But unfortunatelly things happened.
After I press down the jump button when I am holding the move button,it also receives the other button's release event.Which means,I press jump,the moveL and moveR both become false.
So I can jump only on the origin place.

That's not right.
So any idea helping me to deal with such operation which can be very frequently used for a run-jump action game.
Thank you very much.

Pages: [1]