天天看點

02.QucikGesture

  1. 拖拽事件

    添加腳本

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class QucikGesture : MonoBehaviour
{
    /// <summary>
    /// 拖拽事件
    /// </summary>
    /// <param name="id"></param>
    public void Drag(int id)
    {
        Debug.Log(id);
    }
}      

3D物體挂載QuickDrag

三個拖拽事件注冊

02.QucikGesture
02.QucikGesture

03.

02.QucikGesture

一:當有UI進入停止拖拽

二 : 當有物體進入停止拖拽

三:拖拽中是否禁用實體元件,如剛體

  1. 觸摸進入 停止 離開事件 Start - 開始 / In Progress - 正在進行/ End - 結束

    04.長按下 開始 按下中 按下結束

02.QucikGesture

05.縮放Quick Pinch —— 快速捏(縮放)

Quick name —— 快速手勢名(可自定義)

Gesture over me —— 手勢經過我(手勢必須在物體身上上才起作用,2個手勢向量的中心點在也行 — 可調節)

Allow pick over UI element —— 允許選擇UI元素:(透過UI元素拖動物體)

Triggering —— 觸發: (In progress - 正在進行 和 End - 結束)

Pinch direction —— 捏方位: (Pinch In - 向内 和 Pinch Out - 向外)

Enable simple action —— 開啟簡單的功能:(打開一些簡單的設定)

Action —— 功能 (包含了一些簡單的Transform元件設定)

affected Axes —— 受影響的軸(可根據需求自己選擇)

Sensibility —— 靈敏度

Inverse Axes —— 反轉軸

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class QucikGesture : MonoBehaviour
{

    

    public void ScaleChange(float scale)
    {
        //Debug.Log(scale);
        transform.rectTransform().localScale=Vector3.one*scale;
    }
}      
02.QucikGesture

06.Quick Swipe 滑動

Allow swipe start over me —— 允許滑動經過我開始(手勢必須在物體身上上才起作用,2個手勢向量的中心點在也行 — 可調節)

Allow pick over UI element —— 允許選擇UI元素:(透過UI元素拖動物體)

Triggering —— 觸發: (In progress 和 End)

Swipe direction —— 捏方位: (Pinch In 和 Pinch Out) —— 兩個觸控點,向内,向外

Enable simple action —— 開啟簡單的功能:(打開一些簡單的設定)

Action —— 功能 (包含了一些簡單的Transform元件設定)

affected Axes —— 受影響的軸(可根據需求自己選擇)

Sensibility —— 靈敏度

Inverse Axes —— 反轉軸

02.QucikGesture

07.Quick Tap 快速點選

2 fingers gesture —— 兩個指頭 手勢

Action Triggering —— 功能觸發: (Simple_Tap - 單擊 和 Double_Tap - 輕按兩下)

Allow pick over UI element —— 允許選擇UI元素:(透過UI元素拖動物體)

02.QucikGesture

08.Quick Touch 快速觸摸

On Touch (Gesture) —— 添加觸摸事件On Touch Not Over Me (Gesture) —— 不在我身上擡起時的-事件

02.QucikGesture

09.Quick Pinch —— 快速扭/擰

Quick name —— 快速手勢名(可自定義)

Gesture over me —— 手勢經過我(手勢必須在物體身上上才起作用,2個手勢向量的中心點在也行 — 可調節)

Allow pick over UI element —— 允許選擇UI元素:(透過UI元素拖動物體)

Triggering —— 觸發: (In progress - 正在進行 和 End - 結束)

Twist direction —— 扭/擰方位:

Clockwise - 順時針 和 Counterclockwise - 逆時針

Enable simple action —— 開啟簡單的功能:(打開一些簡單的功能設定)

Action —— 功能 (包含了一些簡單的Transform元件設定)

affected Axes —— 受影響的軸(可根據需求自己選擇)

繼續閱讀