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 - covcomm

Pages: [1]
1
Support / Re: tk2dButton could not be found?
« on: October 24, 2012, 04:45:20 pm »
Thanks! It worked!

2
Support / tk2dButton could not be found?
« on: October 24, 2012, 02:43:15 pm »
Hi,

I just bought 2D Toolkit and I'm trying to get some multitouch buttons set up. I keep getting this error when I try to add a script:


"Assets/Standard Assets/Scripts/Button Scripts/JumpButton.cs(17,28): error CS0246: The type or namespace name `tk2dButton' could not be found. Are you missing a using directive or an assembly reference?"

Code: [Select]
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 () {

}
}

Is there a simple way to get rid of this error?

Pages: [1]