This commit is contained in:
2024-10-16 00:03:41 +08:00
commit 897058435c
5033 changed files with 1009728 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 88d29e16d9dfe2e4e9e7d668948f9c78
folderAsset: yes
timeCreated: 1435661090
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class FingerTouch : MonoBehaviour {
private TextMesh textMesh;
public Vector3 deltaPosition = Vector2.zero;
public int fingerId=-1;
void OnEnable(){
EasyTouch.On_TouchStart += On_TouchStart;
EasyTouch.On_TouchUp += On_TouchUp;
EasyTouch.On_Swipe += On_Swipe;
EasyTouch.On_Drag += On_Drag;
EasyTouch.On_DoubleTap += On_DoubleTap;
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
}
void OnDestroy(){
EasyTouch.On_TouchStart -= On_TouchStart;
EasyTouch.On_TouchUp -= On_TouchUp;
EasyTouch.On_Swipe -= On_Swipe;
EasyTouch.On_Drag -= On_Drag;
EasyTouch.On_DoubleTap -= On_DoubleTap;
}
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;
}
}
void On_Swipe (Gesture gesture)
{
if (fingerId == gesture.fingerIndex){
Vector3 position = gesture.GetTouchToWorldPoint(transform.position);
transform.position = position - deltaPosition;
}
}
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;
}
}
void On_TouchUp (Gesture gesture)
{
if (gesture.fingerIndex == fingerId){
fingerId = -1;
textMesh.text="";
}
}
public void InitTouch(int ind){
fingerId = ind;
textMesh.text = fingerId.ToString();
}
void On_DoubleTap (Gesture gesture)
{
if (gesture.pickedObject!=null && gesture.pickedObject.transform.IsChildOf(gameObject.transform)){
DestroyImmediate( transform.gameObject );
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7c81a78944a453f46829a14c2789f59e
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class MutliFingersScreenTouch : MonoBehaviour {
public GameObject touchGameObject;
void OnEnable(){
EasyTouch.On_TouchStart += On_TouchStart;
}
void OnDestroy(){
EasyTouch.On_TouchStart -= 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);
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 917423f633dae9f46afdbd2a301af9d4
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,413 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &162504
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 462504}
- component: {fileID: 21262510}
- component: {fileID: 5862510}
m_Layer: 0
m_Name: TouchSprtie
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &462504
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162504}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.5, y: 1.5, z: 1.5}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 462506}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &21262510
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162504}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 65998af61294ec74a8629a4fe17ef652, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!58 &5862510
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162504}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 0.64
--- !u!1 &162506
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 462506}
- component: {fileID: 11462510}
m_Layer: 0
m_Name: Touch
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &462506
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162506}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -13.03, y: 5.77, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 462508}
- {fileID: 462504}
- {fileID: 462510}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11462510
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162506}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7c81a78944a453f46829a14c2789f59e, type: 3}
m_Name:
m_EditorClassIdentifier:
deltaPosition: {x: 0, y: 0, z: 0}
fingerId: -1
--- !u!1 &162508
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 462508}
- component: {fileID: 9662510}
m_Layer: 0
m_Name: Trail
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &462508
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162508}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 462506}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!96 &9662510
TrailRenderer:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162508}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: d6863324f3084eb4386e890cacfee5c3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Time: 0.6
m_PreviewTimeScale: 1
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
widthCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 1, g: 1, b: 1, a: 1}
key3: {r: 1, g: 1, b: 1, a: 1}
key4: {r: 1, g: 1, b: 1, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 16384
ctime2: 32768
ctime3: 49151
ctime4: 65535
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 16384
atime2: 32768
atime3: 49151
atime4: 65535
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 5
m_NumAlphaKeys: 5
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
textureScale: {x: 1, y: 1}
shadowBias: 0
generateLightingData: 0
m_MinVertexDistance: 0.1
m_MaskInteraction: 0
m_Autodestruct: 0
m_Emitting: 1
m_ApplyActiveColorSpace: 0
--- !u!1 &162510
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 462510}
- component: {fileID: 2362510}
- component: {fileID: 10262510}
m_Layer: 0
m_Name: FingerID
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &462510
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162510}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.34, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 462506}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &2362510
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162510}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!102 &10262510
TextMesh:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 162510}
m_Text:
m_OffsetZ: 0
m_CharacterSize: 0.23
m_LineSpacing: 1
m_Anchor: 4
m_Alignment: 1
m_TabSize: 4
m_FontSize: 36
m_FontStyle: 1
m_RichText: 0
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_Color:
serializedVersion: 2
rgba: 4294967295

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: edd6bb59932bfeb48964819704114a96
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: a17adf9d350388a41817b5ebfc091867
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ce0088f9159699a45a227c42db16dc6c
folderAsset: yes
timeCreated: 1435661090
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: af4d646a671787a4e8db9e671d2287fa
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class DoubleTapMe : MonoBehaviour {
// Subscribe to events
void OnEnable(){
EasyTouch.On_DoubleTap += On_DoubleTap;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_DoubleTap -= On_DoubleTap;
}
// Double tap
private void On_DoubleTap( 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));
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7d557199f581b794bbfd7a9d35a3f973
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,85 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class DragMe : MonoBehaviour {
private TextMesh textMesh;
private Color startColor;
private Vector3 deltaPosition;
private int fingerIndex;
// Subscribe to events
void OnEnable(){
EasyTouch.On_Drag += On_Drag;
EasyTouch.On_DragStart += On_DragStart;
EasyTouch.On_DragEnd += On_DragEnd;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_Drag -= On_Drag;
EasyTouch.On_DragStart -= On_DragStart;
EasyTouch.On_DragEnd -= On_DragEnd;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
// At the drag beginning
void On_DragStart( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
fingerIndex = gesture.fingerIndex;
RandomColor();
// the world coordinate from touch
Vector3 position = gesture.GetTouchToWorldPoint(gesture.pickedObject.transform.position);
deltaPosition = position - transform.position;
}
}
// During the drag
void On_Drag(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject && fingerIndex == gesture.fingerIndex){
// 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();
}
}
// At the drag end
void On_DragEnd(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text="Drag me";
}
}
private void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c0374fa01d32d07449d95d045798efd4
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,71 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class LongTapMe : MonoBehaviour {
private TextMesh textMesh;
private Color startColor;
// Subscribe to events
void OnEnable(){
EasyTouch.On_LongTapStart += On_LongTapStart;
EasyTouch.On_LongTap += On_LongTap;
EasyTouch.On_LongTapEnd += On_LongTapEnd;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_LongTapStart -= On_LongTapStart;
EasyTouch.On_LongTap -= On_LongTap;
EasyTouch.On_LongTapEnd -= On_LongTapEnd;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
// At the long tap beginning
private void On_LongTapStart( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject==gameObject){
RandomColor();
}
}
// During the long tap
private void On_LongTap( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject==gameObject){
textMesh.text = gesture.actionTime.ToString("f2");
}
}
// At the long tap end
private void On_LongTapEnd( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject==gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text="Long tap me";
}
}
private void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e42eb6686b4c49a4b813dd56294fffba
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,56 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class Swipe : MonoBehaviour {
public GameObject trail;
public Text swipeText;
// Subscribe to events
void OnEnable(){
EasyTouch.On_SwipeStart += On_SwipeStart;
EasyTouch.On_Swipe += On_Swipe;
EasyTouch.On_SwipeEnd += On_SwipeEnd;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_SwipeStart -= On_SwipeStart;
EasyTouch.On_Swipe -= On_Swipe;
EasyTouch.On_SwipeEnd -= On_SwipeEnd;
}
// At the swipe beginning
private void On_SwipeStart( Gesture gesture){
swipeText.text = "You start a 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;
}
// At the swipe end
private void On_SwipeEnd(Gesture gesture){
// Get the swipe angle
float angles = gesture.GetSwipeOrDragAngle();
swipeText.text = "Last swipe : " + gesture.swipe.ToString() + " / vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2");
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ec1dbe3df0ef246469010be22ddf3652
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TapMe : MonoBehaviour {
// Subscribe to events
void OnEnable(){
EasyTouch.On_SimpleTap += On_SimpleTap;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_SimpleTap -= On_SimpleTap;
}
// Simple tap
private void On_SimpleTap( 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));
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 0a5d800b35e8f5945878e883b3d2a525
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,67 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TouchMe : MonoBehaviour {
private TextMesh textMesh;
private Color startColor;
// Subscribe to events
void OnEnable(){
EasyTouch.On_TouchStart += On_TouchStart;
EasyTouch.On_TouchDown += On_TouchDown;
EasyTouch.On_TouchUp += On_TouchUp;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_TouchStart -= On_TouchStart;
EasyTouch.On_TouchDown -= On_TouchDown;
EasyTouch.On_TouchUp -= On_TouchUp;
}
void Start () {
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
// At the touch beginning
private void On_TouchStart(Gesture gesture){
if (gesture.pickedObject == gameObject){
RandomColor();
}
}
// 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");
}
}
// At the touch end
private void On_TouchUp(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text ="Touch me";
}
}
private void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 91705704ea736ef41a8cb3a6c149cc38
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6b566d4b95ab5884e9aed875f4f519df
folderAsset: yes
timeCreated: 1435661090
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: d82248ce6f3cbd34680b70fe59a53523
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,91 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class PinchMe : MonoBehaviour {
private TextMesh textMesh;
// Subscribe to events
void OnEnable(){
EasyTouch.On_TouchStart2Fingers += On_TouchStart2Fingers;
EasyTouch.On_PinchIn += On_PinchIn;
EasyTouch.On_PinchOut += On_PinchOut;
EasyTouch.On_PinchEnd += On_PinchEnd;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
// Unsubscribe to events
void UnsubscribeEvent(){
EasyTouch.On_TouchStart2Fingers -= On_TouchStart2Fingers;
EasyTouch.On_PinchIn -= On_PinchIn;
EasyTouch.On_PinchOut -= On_PinchOut;
EasyTouch.On_PinchEnd -= On_PinchEnd;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
}
// At the 2 fingers touch beginning
private void On_TouchStart2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject ){
// disable twist gesture recognize for a real pinch end
EasyTouch.SetEnableTwist( false);
EasyTouch.SetEnablePinch( true);
}
}
// At the pinch in
private void On_PinchIn(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
float zoom = Time.deltaTime * gesture.deltaPinch;
Vector3 scale = transform.localScale ;
transform.localScale = new Vector3( scale.x - zoom, scale.y -zoom, scale.z-zoom);
textMesh.text = "Delta pinch : " + gesture.deltaPinch.ToString();
}
}
// At the pinch out
private void On_PinchOut(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
float zoom = Time.deltaTime * gesture.deltaPinch;
Vector3 scale = transform.localScale ;
transform.localScale = new Vector3( scale.x + zoom, scale.y +zoom,scale.z+zoom);
textMesh.text = "Delta pinch : " + gesture.deltaPinch.ToString();
}
}
// At the pinch end
private void On_PinchEnd(Gesture gesture){
if (gesture.pickedObject == gameObject){
transform.localScale =new Vector3(2.5f,2.5f,2.5f);
EasyTouch.SetEnableTwist( true);
textMesh.text="Pinch me";
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9e0c0637362429045b51848c8ecde3e8
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TooglePickMethodUI : MonoBehaviour {
public void SetPickMethod2Finger(bool value){
if (value)
EasyTouch.SetTwoFingerPickMethod( EasyTouch.TwoFingerPickMethod.Finger);
}
public void SetPickMethod2Averager(bool value){
if (value)
EasyTouch.SetTwoFingerPickMethod( EasyTouch.TwoFingerPickMethod.Average);
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7f681517e2331d74f8b93a0f2f648948
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,77 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwistMe : MonoBehaviour {
private TextMesh textMesh;
// Subscribe to events
void OnEnable(){
EasyTouch.On_TouchStart2Fingers += On_TouchStart2Fingers;
EasyTouch.On_Twist += On_Twist;
EasyTouch.On_TwistEnd += On_TwistEnd;
EasyTouch.On_Cancel2Fingers += On_Cancel2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_TouchStart2Fingers -= On_TouchStart2Fingers;
EasyTouch.On_Twist -= On_Twist;
EasyTouch.On_TwistEnd -= On_TwistEnd;
EasyTouch.On_Cancel2Fingers -= On_Cancel2Fingers;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
}
void On_TouchStart2Fingers(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject ){
// disable twist gesture recognize for a real pinch end
EasyTouch.SetEnableTwist( true);
EasyTouch.SetEnablePinch( false);
}
}
// during the txist
void On_Twist( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
transform.Rotate( new Vector3(0,0,gesture.twistAngle));
textMesh.text = "Delta angle : " + gesture.twistAngle.ToString();
}
}
// at the twist end
void On_TwistEnd( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
EasyTouch.SetEnablePinch( true);
transform.rotation = Quaternion.identity;
textMesh.text ="Twist me";
}
}
// If the two finger gesture is finished
void On_Cancel2Fingers(Gesture gesture){
EasyTouch.SetEnablePinch( true);
transform.rotation = Quaternion.identity;
textMesh.text ="Twist me";
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: dfc81fbca6ade17489686010b0aa93b2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoDoubleTapMe : MonoBehaviour {
// Subscribe to events
void OnEnable(){
EasyTouch.On_DoubleTap2Fingers += On_DoubleTap2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_DoubleTap2Fingers -= 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));
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: fffad73ea4da41a4aa105bd2a8c5d90f
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,92 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoDragMe : MonoBehaviour {
private TextMesh textMesh;
private Vector3 deltaPosition;
private Color startColor;
// Subscribe to events
void OnEnable(){
EasyTouch.On_DragStart2Fingers += On_DragStart2Fingers;
EasyTouch.On_Drag2Fingers += On_Drag2Fingers;
EasyTouch.On_DragEnd2Fingers += On_DragEnd2Fingers;
EasyTouch.On_Cancel2Fingers += On_Cancel2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_DragStart2Fingers -= On_DragStart2Fingers;
EasyTouch.On_Drag2Fingers -= On_Drag2Fingers;
EasyTouch.On_DragEnd2Fingers -= On_DragEnd2Fingers;
EasyTouch.On_Cancel2Fingers -= On_Cancel2Fingers;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
// 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;
}
}
// 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();
}
}
// At the drag end
void On_DragEnd2Fingers(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text="Drag me";
}
}
// If the two finger gesture is finished
void On_Cancel2Fingers(Gesture gesture){
On_DragEnd2Fingers( gesture);
}
void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 85f24bf25a126d046a7f0f659fab80d8
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,71 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoLongTapMe : MonoBehaviour {
private TextMesh textMesh;
private Color startColor;
// Subscribe to events
void OnEnable(){
EasyTouch.On_LongTapStart2Fingers += On_LongTapStart2Fingers;
EasyTouch.On_LongTap2Fingers += On_LongTap2Fingers;
EasyTouch.On_LongTapEnd2Fingers += On_LongTapEnd2Fingers;
EasyTouch.On_Cancel2Fingers += On_Cancel2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_LongTapStart2Fingers -= On_LongTapStart2Fingers;
EasyTouch.On_LongTap2Fingers -= On_LongTap2Fingers;
EasyTouch.On_LongTapEnd2Fingers -= On_LongTapEnd2Fingers;
EasyTouch.On_Cancel2Fingers -= On_Cancel2Fingers;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
// At the long tap beginning
void On_LongTapStart2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
RandomColor();
}
}
// During the long tap
void On_LongTap2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
textMesh.text = gesture.actionTime.ToString("f2");
}
}
// At the long tap end
void On_LongTapEnd2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text="Long tap me";
}
}
// If the two finger gesture is finished
void On_Cancel2Fingers(Gesture gesture){
On_LongTapEnd2Fingers( gesture);
}
void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7a3b433d016ead3409fcbcd22bc9d730
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,57 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoSwipe : MonoBehaviour {
public GameObject trail;
public Text swipeData;
// Subscribe to events
void OnEnable(){
EasyTouch.On_SwipeStart2Fingers += On_SwipeStart2Fingers;
EasyTouch.On_Swipe2Fingers += On_Swipe2Fingers;
EasyTouch.On_SwipeEnd2Fingers += On_SwipeEnd2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_SwipeStart2Fingers -= On_SwipeStart2Fingers;
EasyTouch.On_Swipe2Fingers -= On_Swipe2Fingers;
EasyTouch.On_SwipeEnd2Fingers -= On_SwipeEnd2Fingers;
}
// At the swipe beginning
private void On_SwipeStart2Fingers( Gesture gesture){
swipeData.text = "You start a swipe";
}
// During the swipe
private void On_Swipe2Fingers(Gesture gesture){
// the world coordinate from touch for z=5
Vector3 position = gesture.GetTouchToWorldPoint(5);
trail.transform.position = position;
}
// At the swipe end
private void On_SwipeEnd2Fingers(Gesture gesture){
// Get the swipe angle
float angles = gesture.GetSwipeOrDragAngle();
swipeData.text = "Last swipe : " + gesture.swipe.ToString() + " / vector : " + gesture.swipeVector.normalized + " / angle : " + angles.ToString("f2");
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f134654b31a6bd64abbfe8a3bd3dfbd2
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,36 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoTapMe : MonoBehaviour {
// Subscribe to events
void OnEnable(){
EasyTouch.On_SimpleTap2Fingers += On_SimpleTap2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_SimpleTap2Fingers -= On_SimpleTap2Fingers;
}
// Simple 2 fingers tap
void On_SimpleTap2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
RandomColor();
}
}
void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 051cd1f9ca5241146b22abaf55148bab
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,71 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class TwoTouchMe : MonoBehaviour {
private TextMesh textMesh;
private Color startColor;
// Subscribe to events
void OnEnable(){
EasyTouch.On_TouchStart2Fingers += On_TouchStart2Fingers;
EasyTouch.On_TouchDown2Fingers += On_TouchDown2Fingers;
EasyTouch.On_TouchUp2Fingers += On_TouchUp2Fingers;
EasyTouch.On_Cancel2Fingers += On_Cancel2Fingers;
}
void OnDisable(){
UnsubscribeEvent();
}
void OnDestroy(){
UnsubscribeEvent();
}
void UnsubscribeEvent(){
EasyTouch.On_TouchStart2Fingers -= On_TouchStart2Fingers;
EasyTouch.On_TouchDown2Fingers -= On_TouchDown2Fingers;
EasyTouch.On_TouchUp2Fingers -= On_TouchUp2Fingers;
EasyTouch.On_Cancel2Fingers -= On_Cancel2Fingers;
}
void Start(){
textMesh =(TextMesh) GetComponentInChildren<TextMesh>();
startColor = gameObject.GetComponent<Renderer>().material.color;
}
void On_TouchStart2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
RandomColor();
}
}
void On_TouchDown2Fingers(Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
textMesh.text = "Down since :" + gesture.actionTime.ToString("f2");
}
}
void On_TouchUp2Fingers( Gesture gesture){
// Verification that the action on the object
if (gesture.pickedObject == gameObject){
gameObject.GetComponent<Renderer>().material.color = startColor;
textMesh.text ="Touch me";
}
}
void On_Cancel2Fingers( Gesture gesture){
On_TouchUp2Fingers( gesture);
}
void RandomColor(){
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));
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 18f5c6c178d81794aac2b4aaed8e2443
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: