"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Trigger Animation with Touch Event.

I am fairly new to scripting in Unity and need some direction on how to apply a touch event to a Game Object to trigger an animation.

I'm currenly using javascript to initiate an animation "onMouseDown" when the game object is clicked (this works great). I have an if/else statement that toggles between my "open" and "close" animations.

How would I rewrite the below javascript logic in C#? Is it required to utilize the "IVirtualButtonEventHandler" to initiate an animation on touch event?

var doorObj:GameObject;var isOpen = false;function OnMouseDown(){    Debug.Log("mouse is down");    if(!this.isOpen){        doorObj.animation.Play("close");        this.isOpen = true;    }else{        doorObj.animation.Play("open");        this.isOpen = false;    }}