1
Support / Re: tk2dButton could not be found?
« on: October 24, 2012, 04:45:20 pm »
Thanks! It worked!
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.
using UnityEngine;
using System.Collections;
public class JumpButton : MonoBehaviour {
tk2dButton button;
// Use this for initialization
void Start () {
button = GetComponent<tk2dButton>();
button.ButtonPressedEvent += ButtonPressed;
button.ButtonAutoFireEvent += ButtonAutoFire;
button.ButtonDownEvent += ButtonDown;
button.ButtonUpEvent += ButtonUp;
}
void ButtonPressed(tk2dButton source)
{
Debug.Log("Pressed");
}
void ButtonAutoFire(tk2dButton source)
{
Debug.Log("Autofire");
}
void ButtonDown(tk2dButton source)
{
Debug.Log("Down");
}
void ButtonUp(tk2dButton source)
{
Debug.Log("Up");
}
// Update is called once per frame
void Update () {
}
}