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...
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.
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;
}
}