当前位置: 首页>>代码示例>>C#>>正文


C# Gesture.GetTouchToWorldPoint方法代码示例

本文整理汇总了C#中Gesture.GetTouchToWorldPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Gesture.GetTouchToWorldPoint方法的具体用法?C# Gesture.GetTouchToWorldPoint怎么用?C# Gesture.GetTouchToWorldPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gesture的用法示例。


在下文中一共展示了Gesture.GetTouchToWorldPoint方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: On_Swipe

	// During the swipe
	private void On_Swipe(Gesture gesture){

		// the world coordinate from touch for z=5
		Vector3 position = gesture.GetTouchToWorldPoint(5);
		trail.transform.position = position;

	}
开发者ID:krooq,项目名称:catotype,代码行数:8,代码来源:Swipe.cs

示例2: On_Swipe

	void On_Swipe (Gesture gesture)
	{
		if (fingerId == gesture.fingerIndex){
			Vector3 position = gesture.GetTouchToWorldPoint(transform.position);
			transform.position = position - deltaPosition;
		}
	}
开发者ID:krooq,项目名称:catotype,代码行数:7,代码来源:FingerTouch.cs

示例3: On_Drag

	void On_Drag (Gesture gesture)
	{
		if ( gesture.pickedObject.transform.IsChildOf(gameObject.transform) && fingerId == gesture.fingerIndex){
			Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
			transform.position = position - deltaPosition;
		}
	}
开发者ID:krooq,项目名称:catotype,代码行数:7,代码来源:FingerTouch.cs

示例4: On_TouchStart

	void On_TouchStart (Gesture gesture)
	{
		if (gesture.pickedObject == null){
			Vector3 position = gesture.GetTouchToWorldPoint(5);
		
			(Instantiate( touchGameObject,position, Quaternion.identity) as GameObject).GetComponent<FingerTouch>().InitTouch( gesture.fingerIndex);
		}

	}
开发者ID:krooq,项目名称:catotype,代码行数:9,代码来源:MutliFingersScreenTouch.cs

示例5: On_TouchStart

	void On_TouchStart (Gesture gesture)
	{
		if (gesture.pickedObject!=null && gesture.pickedObject.transform.IsChildOf(gameObject.transform)){
			fingerId = gesture.fingerIndex;
			textMesh.text = fingerId.ToString();

			Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
			deltaPosition = position - transform.position;
		}
	}
开发者ID:krooq,项目名称:catotype,代码行数:10,代码来源:FingerTouch.cs

示例6: On_DragStart2Fingers

	// At the drag beginning
	void On_DragStart2Fingers(Gesture gesture){

		// Verification that the action on the object
		if (gesture.pickedObject == gameObject){	
			RandomColor();
		
			// the world coordinate from touch
			Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
			deltaPosition = position - transform.position;
		}
	}
开发者ID:krooq,项目名称:catotype,代码行数:12,代码来源:TwoDragMe.cs

示例7: On_Drag2Fingers

    // During the drag
    void On_Drag2Fingers(Gesture gesture)
    {
        // Verification that the action on the object
        if (gesture.pickedObject == gameObject){

            // the world coordinate from touch
            Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
            transform.position = position - deltaPosition;

            // Get the drag angle
            float angle = gesture.GetSwipeOrDragAngle();

            textMesh.text =   angle.ToString("f2") + " / " + gesture.swipe.ToString();
        }
    }
开发者ID:acorrow,项目名称:ToddlerPop,代码行数:16,代码来源:TwoDragMe.cs

示例8: GetTouch

 private Vector3 GetTouch(Gesture gesture)
 {
     return gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
 }
开发者ID:Delacrowa,项目名称:project1,代码行数:4,代码来源:ETOnDrag.cs

示例9: EasyTouch_On_TouchStart

 void EasyTouch_On_TouchStart(Gesture gesture)
 {
     if (IsPause == false) {
         Pad.Open ();
         Pad.SetPadPosition (gesture.GetTouchToWorldPoint (0f));
     }
 }
开发者ID:wang-yichun,项目名称:Sadyrinth,代码行数:7,代码来源:GameController.cs

示例10: EasyTouch_On_SwipeStart

 void EasyTouch_On_SwipeStart(Gesture gesture)
 {
     OnSwipeStartPosition = gesture.startPosition;
     Pad.Open ();
     Pad.SetPadPosition (gesture.GetTouchToWorldPoint (0f), true);
 }
开发者ID:wang-yichun,项目名称:Sadyrinth,代码行数:6,代码来源:GameController.cs

示例11: On_Drag

        void On_Drag(Gesture gesture)
        {
            if (!isCollision)
                return;

            if (specifyDraggableObject) {
                if (gesture.pickedObject == gameO) {

                    if (reverseAxis) {
                        Vector3 position = gesture.GetTouchToWorldPoint (EasyTouch.GetCamera ().transform.position.z - gameO.transform.position.z);
                        gameO.transform.position = position - deltaPosition;
                    }
                    else {
                        Vector3 position = gesture.GetTouchToWorldPoint (gameO.transform.position.z - EasyTouch.GetCamera ().transform.position.z);
                        gameO.transform.position = position - deltaPosition;
                    }

                }
            } else {

                if (reverseAxis) {
                    Vector3 position = gesture.GetTouchToWorldPoint (EasyTouch.GetCamera ().transform.position.z - gesture.pickedObject.transform.position.z);
                    gesture.pickedObject.transform.position = position - deltaPosition;
                }
                else {
                    Vector3 position = gesture.GetTouchToWorldPoint (gesture.pickedObject.transform.position.z - EasyTouch.GetCamera ().transform.position.z);
                    gesture.pickedObject.transform.position = position - deltaPosition;
                }
            }
            //Fsm.Event(sendEventOnDragEnd);
        }
开发者ID:michaelgenn,项目名称:Dodge-This,代码行数:31,代码来源:EasyTouchDrag.cs

示例12: On_DragStart2Fingers

        void On_DragStart2Fingers(Gesture gesture)
        {
            isCollision = true;

            if (specifyDraggableObject) {
                if (gesture.pickedObject == gameO) {
                    if (reverseAxis) {
                        gameO.GetComponent<Rigidbody>().isKinematic = true;
                        Vector3 position = gesture.GetTouchToWorldPoint (gameO.transform.position.z - EasyTouch.GetCamera ().transform.position.z);
                        deltaPosition =  gameO.transform.position - position;
                    }
                    else {
                        gameO.GetComponent<Rigidbody>().isKinematic = true;
                        Vector3 position = gesture.GetTouchToWorldPoint (gameO.transform.position.z - EasyTouch.GetCamera ().transform.position.z);
                        deltaPosition = position - gameO.transform.position;
                    }
                }
            } else {
                if (reverseAxis) {
                    gesture.pickedObject.GetComponent<Rigidbody>().isKinematic = true;
                    Vector3 position = gesture.GetTouchToWorldPoint (EasyTouch.GetCamera ().transform.position.z - gesture.pickedObject.transform.position.z);
                    deltaPosition = gesture.pickedObject.transform.position - position;
                }
                else {
                    gesture.pickedObject.GetComponent<Rigidbody>().isKinematic = true;
                    Vector3 position = gesture.GetTouchToWorldPoint (EasyTouch.GetCamera ().transform.position.z - gesture.pickedObject.transform.position.z);
                    deltaPosition = position - gesture.pickedObject.transform.position;
                }
            }

            //Fsm.Event(sendEventOnDragEnd);
        }
开发者ID:michaelgenn,项目名称:Dodge-This,代码行数:32,代码来源:EasyTouchDrag.cs


注:本文中的Gesture.GetTouchToWorldPoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。