C# problems...

Hello. I have looked around at examples and information on how to convert C# to JS(I know it is a vital skill…I’m trying to learn), but I am still having some troubles. I am using the prime31 UI tool and I when I tried to convert this

using UnityEngine;
using System.Collections;


public class SwipeManager : MonoBehaviour
{
	void Start()
	{
		var swipeDetector = UISwipeDetector.create( new Rect( 0, 0, Screen.width, Screen.height ), 1 );
		swipeDetector.onSwipe += detectedSwipe;	
	}


	void detectedSwipe( UISwipeDetector sender, SwipeDirection direction )
	{
		Debug.Log( "swipe direction: " + direction );
	}
    public Transform target;
    void Update() {
        Vector3 screenPos = camera.WorldToScreenPoint(target.position);
        print("target is " + screenPos.x + " pixels from the left");
    }

}

To this:

function Update(){
		var swipeDetector = UISwipeDetector.create( new Rect( 0, 0, Screen.width, Screen.height ), 1 );
		swipeDetector.onSwipe += detectedSwipe;	
}

function detectedSwipe( UISwipeDetector sender, SwipeDirection direction ){
		Debug.Log( "swipe direction: " + direction );
}

I get errors about “sender” and direction (on the 6th line) being unexpected. What am I doing wrong? Thanks

It’s a simple syntax issue. The line should go-

function detectedSwipe(sender : UISwipeDetector, direction : SwipeDirection){