本文整理汇总了C#中Gesture类的典型用法代码示例。如果您正苦于以下问题:C# Gesture类的具体用法?C# Gesture怎么用?C# Gesture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gesture类属于命名空间,在下文中一共展示了Gesture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: On_LongTap
private void On_LongTap(Gesture gesture)
{
if (gesture.pickObject == base.gameObject)
{
this.textMesh.text = gesture.actionTime.ToString("f2");
}
}
示例2: OnRelease
public virtual void OnRelease(Gesture G)
{
if (_pressedGID == -1)
return;
_pressedGID = -1;
GestureController.OnGestureEnd -= OnGestureEnd;
}
示例3: On_SimpleTap
// Simple tap
private void On_SimpleTap( Gesture gesture)
{
// Verification that the action on the object
if (gesture.pickObject == gameObject){
gameObject.renderer.material.color = new Color( Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f));
}
}
示例4: On_TouchDown2Fingers
private void On_TouchDown2Fingers(Gesture gesture)
{
if (gesture.pickObject == base.gameObject)
{
this.textMesh.text = "Down since :" + gesture.actionTime.ToString("f2");
}
}
示例5: On_DragEnd
// At the drag end
void On_DragEnd(Gesture gesture)
{
if (gesture.pickObject == gameObject){
this.transform.localRotation = this.transform.localRotation;
gameObject.GetComponent<Renderer>().material.color = Color.white;
}
}
示例6: On_DoubleTap2Fingers
// Double Tap
void On_DoubleTap2Fingers( Gesture gesture)
{
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = new Color( Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f));
}
}
示例7: On_TouchStart
private void On_TouchStart(Gesture gesture)
{
if (gesture.pickedObject == null) return;
CurrentPosition = GetTouch(gesture);
DeltaPosition = CurrentPosition - transform.position;
OnTouchStart();
}
示例8: On_LongTapEnd2Fingers
// At the long tap end
void On_LongTapEnd2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickObject == gameObject){
gameObject.renderer.material.color = new Color(1f,1f,1f);
textMesh.text="Long tap";
}
}
示例9: HandleOn_Swipe
void HandleOn_Swipe(Gesture gesture)
{
if( gesture.swipe == EasyTouch.SwipeDirection.Up){
Fsm.Event(Up);
}
if( gesture.swipe == EasyTouch.SwipeDirection.UpLeft){
Fsm.Event(UpLeft);
}
if( gesture.swipe == EasyTouch.SwipeDirection.UpRight){
Fsm.Event(UpRight);
}
if(gesture.swipe == EasyTouch.SwipeDirection.Down){
Fsm.Event(Down);
}
if(gesture.swipe == EasyTouch.SwipeDirection.DownLeft){
Fsm.Event(DownLeft);
}
if(gesture.swipe == EasyTouch.SwipeDirection.DownRight){
Fsm.Event(DownRight);
}
if(gesture.swipe == EasyTouch.SwipeDirection.Left){
Fsm.Event(Left);
}
if(gesture.swipe == EasyTouch.SwipeDirection.Right){
Fsm.Event(Right);
}
}
示例10: PointEventArgs
public PointEventArgs(Gesture gesture, int x, int y)
: base()
{
this.X = x;
this.Y = y;
this.Gesture = gesture;
}
示例11: On_Cancel2Fingers
private void On_Cancel2Fingers(Gesture gesture)
{
if (gesture.touchCount > 0)
{
this.newPivot = true;
}
}
示例12: OnGUI
void OnGUI()
{
GUI.Box(drawArea, "Draw Area");
GUI.Label(new Rect(10, Screen.height - 40, 500, 50), message);
if (GUI.Button(new Rect(Screen.width - 100, 10, 100, 30), "Recognize")) {
recognized = true;
Gesture candidate = new Gesture(points.ToArray());
string gestureResult = PointCloudRecognizer.Classify(candidate, trainingSet.ToArray());
message = gestureResult;
Debug.Log("Message:" + message);
}
GUI.Label(new Rect(Screen.width - 200, 150, 70, 30), "Add as: ");
newGestureName = GUI.TextField(new Rect(Screen.width - 150, 150, 100, 30), newGestureName);
if (GUI.Button(new Rect(Screen.width - 50, 150, 50, 30), "Add") && points.Count > 0 && newGestureName != "") {
string fileName = String.Format("{0}/{1}-{2}.xml", Application.persistentDataPath, newGestureName, DateTime.Now.ToFileTime());
Debug.Log(Application.persistentDataPath);
#if !UNITY_WEBPLAYER
DataGestures.Save(points, strokeId+1, fileName, newGestureName );
#endif
trainingSet.Add(new Gesture(points.ToArray(), newGestureName));
newGestureName = "";
}
}
示例13: On_LongTapStart
// At the long tap beginning
private void On_LongTapStart( Gesture gesture){
// Verification that the action on the object
if (gesture.pickObject==gameObject){
gameObject.GetComponent<Renderer>().material.color = new Color( Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f), Random.Range(0.0f,1.0f));
}
}
示例14: On_SimpleTap
private void On_SimpleTap(Gesture gesture)
{
if (gesture.pickedObject != null)
{
if (spawnerDisplayEnabled)
HideSpawnerOptions();
if (turretSelectDisplayEnabled)
HideTurretSelectTab();
if (gesture.pickedObject.tag == "SpawnPosition")
{
AllySpawnerPosition allySpawnerPosition = gesture.pickedObject.GetComponent<AllySpawnerPosition>();
ShowSpawnerOptions(allySpawnerPosition);
}
if (gesture.pickedObject.tag == "Ally")
{
structureController = gesture.pickedObject.GetComponent<AllyStructureController>();
if (structureController.IsTurret)
{
destroyTurretTab.StructureController = gesture.pickedObject.GetComponentInChildren<AllyStructureController>();
turretSelectWidget.SetAnchor(gesture.pickedObject.transform);
ShowTurretSelectTab();
}
}
}
}
示例15: On_TouchDown
// During the touch is down
private void On_TouchDown(Gesture gesture)
{
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
textMesh.text = "Down since :" + gesture.actionTime.ToString("f2");
}
}