- Home /
Question by
andonnitsolingkas · Nov 15, 2018 at 05:36 PM ·
buttonerror messagerotate objectbutton trigger eventsvirtual functions
Assets/vb_anim.cs(7,14): error CS0535: `vbButton' does not implement interface member
Hi all, I have a problem with my unity script. I'm trying to make a virtual button so I can rotate my cube. I have an error popping up and I just don't know how to fix this. First I thought it was some kind of spelling error but that does not seem to be the case I think... Any ideas? This is my code:
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia;
public class vbButton : MonoBehaviour, IVirtualButtonEventHandler {
public GameObject vbBtnObj;
public Animator cubeAni;
// Use this for initialization
void Start()
{
vbBtnObj = GameObject.Find("LacieBtn");
vbBtnObj.GetComponent<VirtualButtonBehaviour>().RegisterEventHandler(this);
cubeAni.GetComponent<Animator>();
}
public void OnButtonPressed(VirtualButtonBehaviour vb)
{
cubeAni.Play("cube_animation");
Debug.Log("Button Pressed");
}
public void OnButtonReleased(VirtualButtonBehaviour vb)
{
cubeAni.Play("none");
Debug.Log("Button Released");
}
}
Comment