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,41 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class ETWindow : MonoBehaviour {
private bool drag = false;
void OnEnable(){
EasyTouch.On_TouchDown += On_TouchDown;
EasyTouch.On_TouchStart += On_TouchStart;
}
void OnDestroy(){
EasyTouch.On_TouchDown -= On_TouchDown;
EasyTouch.On_TouchStart -= On_TouchStart;
}
void On_TouchStart (Gesture gesture){
drag = false;
if (gesture.isOverGui){
if (gesture.pickedUIElement == gameObject || gesture.pickedUIElement.transform.IsChildOf( transform)){
transform.SetAsLastSibling();
drag = true;
}
}
}
void On_TouchDown (Gesture gesture){
if (gesture.isOverGui){
if ((gesture.pickedUIElement == gameObject || gesture.pickedUIElement.transform.IsChildOf( transform)) && drag){
transform.position += (Vector3)gesture.deltaPosition;
}
}
}
}

View File

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

View File

@@ -0,0 +1,55 @@
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class GlobalEasyTouchEvent : MonoBehaviour {
public Text statText;
void OnEnable(){
EasyTouch.On_TouchDown += On_TouchDown;
EasyTouch.On_TouchUp += On_TouchUp;
EasyTouch.On_OverUIElement += On_OverUIElement;
EasyTouch.On_UIElementTouchUp += On_UIElementTouchUp;
}
void OnDestroy(){
EasyTouch.On_TouchDown -= On_TouchDown;
EasyTouch.On_TouchUp -= On_TouchUp;
EasyTouch.On_OverUIElement -= On_OverUIElement;
EasyTouch.On_UIElementTouchUp -= On_UIElementTouchUp;
}
void On_TouchDown (Gesture gesture){
Debug.Log("ok");
statText.transform.SetAsFirstSibling();
if (gesture.pickedUIElement!=null){
statText.text = "You touch UI Element : " + gesture.pickedUIElement.name + " (from gesture event)";
}
if (!gesture.isOverGui && gesture.pickedObject==null ){
statText.text = "You touch an empty area";
}
if (gesture.pickedObject!= null && !gesture.isOverGui){
statText.text = "You touch a 3D Object";
}
}
void On_OverUIElement (Gesture gesture){
statText.text = "You touch UI Element : " + gesture.pickedUIElement.name + " (from On_OverUIElement event)";
}
void On_UIElementTouchUp (Gesture gesture){
statText.text = "";
}
void On_TouchUp (Gesture gesture){
statText.text = "";
}
}

View File

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

View File

@@ -0,0 +1,10 @@
using UnityEngine;
using System.Collections;
using HedgehogTeam.EasyTouch;
public class UICompatibility : MonoBehaviour {
public void SetCompatibility(bool value){
EasyTouch.SetUICompatibily( value);
}
}

View File

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

View File

@@ -0,0 +1,14 @@
using UnityEngine;
using UnityEngine.EventSystems;
using HedgehogTeam.EasyTouch;
public class UIWindow : MonoBehaviour, IDragHandler, IPointerDownHandler{
public void OnDrag (PointerEventData eventData){
transform.position += (Vector3)eventData.delta;
}
public void OnPointerDown (PointerEventData eventData){
transform.SetAsLastSibling();
}
}

View File

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