本文整理汇总了C#中DragInfo类的典型用法代码示例。如果您正苦于以下问题:C# DragInfo类的具体用法?C# DragInfo怎么用?C# DragInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DragInfo类属于命名空间,在下文中一共展示了DragInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DraggingHandler
void DraggingHandler(DragInfo dragInfo)
{
if (debug) Debug.Log("====DraggingHandler====\n|| fingercount: " + dragInfo.fingerCount +
" || index: " + dragInfo.index +
" || isFlick: " + dragInfo.isFlick +
" || pos: " + dragInfo.pos );
if (dragInfo.pos.x / Screen.width <= 0.3)
{
yTouchLeft = dragInfo.pos.y / Screen.height;
Debug.Log("Left: " + yTouchLeft );
}
if (dragInfo.pos.x / Screen.width >= 0.7)
{
yTouchRight = dragInfo.pos.y / Screen.height;
Debug.Log("Right: " + yTouchRight );
}
speedModifier = (yTouchLeft >= yTouchRight) ? yTouchLeft : yTouchRight;
directionModifier = yTouchLeft - yTouchRight;
Debug.Log("Direction: " + directionModifier );
Debug.Log("speedModifier: " + speedModifier );
Vector3 pos = Megaman.transform.localPosition;
pos.x = megamanInitialX + directionModifier*-1;
float offsettedSpeedModifier = speedModifier - 0.5f;
pos.z = megamanInitialZ + offsettedSpeedModifier;
Megaman.transform.localPosition = pos;
//Debug.Log("orbit.XModifier: "+orbit.XModifier);
}
示例2: DraggingStartHandler
void DraggingStartHandler(DragInfo dragInfo)
{
if (debug) Debug.Log("====DraggingStartHandler====\n|| fingercount: " + dragInfo.fingerCount +
" || index: " + dragInfo.index +
" || isFlick: " + dragInfo.isFlick +
" || pos: " + dragInfo.pos );
}
示例3: OnDraggingEnd
void OnDraggingEnd(DragInfo drag)
{
pointer.enabled = false;
IT_Gesture.onMouse1E -= OnTouch;
IT_Gesture.onDraggingEndE -= OnDraggingEnd;
}
示例4: OnChargeForMove
//スワイプによる移動操作検知
void OnChargeForMove(DragInfo dragInfo)
{
//自分キャラ
if (BCharacterManager.Instance.GetCharacterOnTile(dragInfo.pos) != this.character) return;
//キャラクター移動用
IT_Gesture.onDraggingEndE += OnDragMove;
}
示例5: OnDraggingStart
//移動開始
void OnDraggingStart(DragInfo drag)
{
//タッチ位置取得
dragPosition = drag.pos;
IT_Gesture.onMouse1E += OnTouch;
IT_Gesture.onDraggingEndE += OnDraggingEnd;
}
示例6: OnDrag
void OnDrag(DragInfo info)
{
if (vertical) scrollDelta = info.delta.y;
else scrollDelta = info.delta.x;
MoveChildren(scrollDelta*scrollSpeed);
scrollDelta /= Mathf.Abs(scrollDelta);
}
示例7: OnDragging
//called when one finger drag are detected
void OnDragging(DragInfo dragInfo)
{
//apply the DPI scaling
dragInfo.delta/=IT_Gesture.GetDPIFactor();
//vertical movement is corresponded to rotation in x-axis
this.orbitSpeedX=-dragInfo.delta.y* this.rotXSpeedModifier;
//horizontal movement is corresponded to rotation in y-axis
this.orbitSpeedY=dragInfo.delta.x* this.rotYSpeedModifier;
}
示例8: OnDraggingStart
//移動開始
void OnDraggingStart(DragInfo drag)
{
//タッチ位置取得
pointer.enabled = true;
DragPosition = drag.pos;
IT_Gesture.onMouse1E += OnTouch;
IT_Gesture.onDraggingEndE += OnDraggingEnd;
}
示例9: HandleGestureonDraggingStartE
void HandleGestureonDraggingStartE(DragInfo dragInfo)
{
if (!isDragging) return;
Transform puck = PickObject (dragInfo.pos);
if (puck) {
lastPuck = puck;
baseHeight = puck.position.y;
puck.renderer.material.color = Color.green;
}
}
示例10: HandleDragging
void HandleDragging(DragInfo dragInfo)
{
if (!isDragging) return;
if (lastPuck) {
DisplayText ("Dragging puck to: " + dragInfo.pos);
Vector3 worldPos = GetWorldPos (dragInfo.pos);
lastPuck.transform.position = worldPos;
} else {
DisplayText ("Dragging to: " + dragInfo.pos);
}
}
示例11: Obj2ToCursor
//assign dragObj2 to the dragInfo position, and display the appropriate tooltip
void Obj2ToCursor(DragInfo dragInfo)
{
Vector3 p=Camera.main.ScreenToWorldPoint(new Vector3(dragInfo.pos.x, dragInfo.pos.y, 30));
dragObj2.position=p;
if(dragInfo.isMouse){
dragTextMesh2.text="Dragging with mouse"+(dragInfo.index+1);
}
else{
dragTextMesh2.text="Dragging with finger"+(dragInfo.index+1);
}
}
示例12: OnDragging
//called when one finger drag are detected
void OnDragging(DragInfo dragInfo)
{
//if the drag is perform using mouse2, use it as a two finger drag
if(dragInfo.isMouse && dragInfo.index==1) OnMFDragging(dragInfo);
//else perform normal orbiting
else{
//vertical movement is corresponded to rotation in x-axis
orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier;
//horizontal movement is corresponded to rotation in y-axis
orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier;
}
}
示例13: MouseRoutine
IEnumerator MouseRoutine(int index)
{
mouseIndex.Add(index);
bool dragStarted=false;
Vector2 startPos=Input.mousePosition;
Vector2 lastPos=startPos;
float timeStart=Mathf.Infinity;
while(mouseIndex.Contains(index)){
Vector2 curPos=Input.mousePosition;
if(!dragStarted){
if(Vector3.Distance(curPos, startPos)>minDragDistance){
dragStarted=true;
Vector2 delta=curPos-startPos;
DragInfo dragInfo=new DragInfo(curPos, delta, 1, index, true);
IT_Gesture.DraggingStart(dragInfo);
timeStart=Time.realtimeSinceStartup;
}
}
else{
if(curPos!=lastPos){
Vector2 delta=curPos-lastPos;
DragInfo dragInfo=new DragInfo(curPos, delta, 1, index, true);
IT_Gesture.Dragging(dragInfo);
}
else if(fireOnDraggingWhenNotMoving){
DragInfo dragInfo=new DragInfo(curPos, Vector2.zero, 1, index, true);
IT_Gesture.Dragging(dragInfo);
}
}
lastPos=curPos;
yield return null;
}
if(dragStarted){
bool isFlick=false;
if(Time.realtimeSinceStartup-timeStart<0.5f) isFlick=true;
Vector2 delta=lastPos-startPos;
DragInfo dragInfo=new DragInfo(lastPos, delta, 1, index, isFlick, true);
IT_Gesture.DraggingEnd(dragInfo);
}
}
示例14: OnDragging
//called when one finger drag are detected
void OnDragging(DragInfo dragInfo)
{
Debug.Log("drag "+dragInfo.delta);
if(dragInfo.type!=2){
//vertical movement is corresponded to rotation in x-axis
orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier;
//horizontal movement is corresponded to rotation in y-axis
orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier;
}
//if the drag is perform using mouse2, use it as a two finger drag
if(dragInfo.type==2) OnDFDragging(dragInfo);
}
示例15: OnDragging
//called when one finger drag are detected
void OnDragging(DragInfo dragInfo)
{
//if the drag is perform using mouse2, use it as a two finger drag
if(dragInfo.isMouse && dragInfo.index==1) this.OnMFDragging(dragInfo);
//else perform normal orbiting
else{
//apply the DPI scaling
dragInfo.delta/=IT_Gesture.GetDPIFactor();
//vertical movement is corresponded to rotation in x-axis
this.orbitSpeedX=-dragInfo.delta.y* this.rotXSpeedModifier;
//horizontal movement is corresponded to rotation in y-axis
this.orbitSpeedY=dragInfo.delta.x* this.rotYSpeedModifier;
}
}