本文整理汇总了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;
}
示例2: On_Swipe
void On_Swipe (Gesture gesture)
{
if (fingerId == gesture.fingerIndex){
Vector3 position = gesture.GetTouchToWorldPoint(transform.position);
transform.position = position - deltaPosition;
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
}
示例8: GetTouch
private Vector3 GetTouch(Gesture gesture)
{
return gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
}
示例9: EasyTouch_On_TouchStart
void EasyTouch_On_TouchStart(Gesture gesture)
{
if (IsPause == false) {
Pad.Open ();
Pad.SetPadPosition (gesture.GetTouchToWorldPoint (0f));
}
}
示例10: EasyTouch_On_SwipeStart
void EasyTouch_On_SwipeStart(Gesture gesture)
{
OnSwipeStartPosition = gesture.startPosition;
Pad.Open ();
Pad.SetPadPosition (gesture.GetTouchToWorldPoint (0f), true);
}
示例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);
}
示例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);
}