Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Sending the C# function parameter to JS function.

$
0
0
I'm trying to implement kinect to one of my games. Already got the function which listens to kinect gestures and recognises them well. Function is written in C#. It basically set boolean function to true after the gesture, than other function is setting it back to false just to reset the flag. if (gesture == KinectGestures.Gestures.SwipeLeft) { swipeLeft = true; } public bool IsSwipeLeft() { if (swipeLeft) { swipeLeft = false; return true; } return false; } I've been trying to send that boolean variable to JS function that works as character controller. I did it like that public var gesturesListener: GestureListener; //in start() gesturesListener=this.GetComponent(GestureListener); //in controlling function if(gesturesListener.IsSwipeLeft()) { GestureInfo.text = "left"; return SwipeDirection.Left; } I also tried checking the if swipeLeft var is true but with no effect. I set up debuging to check if it's working or not. Does enyone have an idea, how to fix it? Thanks.

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>