Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9e496a9
Fixed an issue with UWP (issue 254).
valyard Aug 15, 2017
307ba6c
Added emulating two fingers swipe with LeftControl.
zsaladin Sep 2, 2017
47d4e72
Fixed wrong indents.
zsaladin Sep 3, 2017
6f3a1a5
Added emulating two fingers opposite direction drag with LeftSwift.
zsaladin Sep 3, 2017
55114e4
Fixed an issue with UI recognition breaking when StandardLayer is dis…
valyard Sep 6, 2017
40fd913
Merge branch 'develop' of https://github.com/zsaladin/TouchScript int…
valyard Sep 9, 2017
889b455
Fixed a typo, not failing with null inputsource on a pointer.
valyard Sep 20, 2017
c4bdb65
Fix IsInvalidPosition
midnightSuyama Sep 15, 2017
8ad2268
Fixed a 17.3 warning.
valyard Sep 28, 2017
e95cf04
Added all SendMessage events to TouchManager.prefab.
valyard Sep 28, 2017
799a6b6
Fixed warnings.
valyard Sep 28, 2017
8d68d39
Fixed TS being stuck in uninitialized state when Application.CancelQu…
valyard Sep 28, 2017
f6347ac
Saved scenes in 5.6 serialization format.
valyard Sep 28, 2017
4714076
Disabled FileWriterLogger in debug mode in builds because it fails on…
valyard Sep 28, 2017
b79e1d9
Updated comments for TransformCompleted.TransformCompleted, updated t…
valyard Oct 24, 2017
db84132
Project settings with 5.6 serialization.
valyard Nov 30, 2017
645147d
- InputHandlers now instantiate pointers with parent InputSource as t…
valyard Nov 30, 2017
5c5a76d
Added an ability to edit layer names.
valyard Nov 30, 2017
2830679
Fixed build errors on Windows.
valyard Dec 12, 2017
74f5cb7
Changed lambdas to functions in touch handlers.
valyard Dec 12, 2017
dea4233
Fixed the value being unchangeable from infinity when there are multi…
ganaware Dec 5, 2017
2b5033b
Fixed issues of NullToggleDrawer when there are multiple inspectores
ganaware Dec 6, 2017
3352cc2
Fixed an issue of limit pointers when there are multiple inspectores
ganaware Dec 6, 2017
364fdd2
Simplified SerializedPropertyUserData.
valyard Dec 13, 2017
7ab07a1
Refactored NullPointerDrawer.
valyard Dec 13, 2017
b7afb7d
Fixed issue where ICoordinateRemapper was bypassed when dragging touc…
yesyesnono Feb 2, 2018
8ae0e1d
mouseDown was depecated
southrop Jul 10, 2018
0f7aceb
Samsung TV and WiiU are deprecated
southrop Jul 10, 2018
dc15a8a
EnumMaskField was deprecated in 2017.3
southrop Jul 10, 2018
cb5195a
Remove newline at EOF
southrop Jul 10, 2018
4b389d8
Consistency fix
southrop Jul 10, 2018
044c579
Tizen deprecated in 2018.2
southrop Jul 11, 2018
c4dbbc0
PS Vita (PSP2) deprecated as of 2018.3
southrop Dec 14, 2018
36ab95b
Fix StandardLayer to work after re-enabled.
JamesKim2998 Jan 30, 2019
439c51a
Merge remote-tracking branch 'southrop/master'
Dec 7, 2019
1cb3173
Merge remote-tracking branch 'origin/develop'
Dec 7, 2019
0e4d434
Support for "disable domain / scene reloading".
Dec 7, 2019
abead4b
Descriptive layer name.
Dec 7, 2019
4c40ca7
누락된 WindowsTouch.dll 추가.
Feb 11, 2020
8876fb3
asmdef 분리.
Feb 11, 2020
f4d304f
Examples 제거.
Feb 11, 2020
41e266c
TUIO 제거.
Feb 11, 2020
cb9f808
GraphicRaycaster 를 이용해서 터치가 발생한 그래픽요소를 탐색.
Jun 22, 2020
2688976
SessionStateManager 에서 EventSystem 를 견고하게 탐색하도록 다듬음.
Feb 24, 2021
02978dc
IOS, Android에 대하여 펜 입력을 위해 mouse handler 활성화
seungdaebaek-dev Apr 30, 2021
7691a08
fix missing cursor texture when domain reload disabled.
Nov 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions Source/Assets/TouchScript/Editor/Gestures/GestureEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,19 @@ protected virtual void drawLimits()
EditorGUILayout.LabelField("Min: " + (int) minPointersFloat + ", Max: " + (int) maxPointersFloat);
EditorGUILayout.MinMaxSlider(ref minPointersFloat, ref maxPointersFloat, 0, 10, GUILayout.MaxWidth(150));
EditorGUI.indentLevel--;
minPointers.intValue = (int) minPointersFloat;
maxPointers.intValue = (int) maxPointersFloat;
}
else
{
if (limitPointers)
{
minPointersFloat = 0;
maxPointersFloat = 0;
minPointers.intValue = (int) minPointersFloat;
maxPointers.intValue = (int) maxPointersFloat;
}
}

minPointers.intValue = (int) minPointersFloat;
maxPointers.intValue = (int) maxPointersFloat;
}

protected virtual void drawFriendlyGestures()
Expand Down
12 changes: 11 additions & 1 deletion Source/Assets/TouchScript/Editor/Layers/FullscreenLayerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,31 @@ namespace TouchScript.Editor.Layers
[CustomEditor(typeof(FullscreenLayer))]
internal sealed class FullscreenLayerEditor : UnityEditor.Editor
{
public static readonly GUIContent TEXT_NAME = new GUIContent("Name", "Layer name.");
public static readonly GUIContent TEXT_HELP = new GUIContent("This component receives all pointers which were not caught by other layers. It sets poitners' Target property to itself, so all fullscreen gestures must be attached to the same GameObject as FullscreenGesture.");

private SerializedProperty layerName;
private SerializedProperty type, camera;
private FullscreenLayer instance;

private void OnEnable()
{
instance = target as FullscreenLayer;

layerName = serializedObject.FindProperty("layerName");
type = serializedObject.FindProperty("type");
camera = serializedObject.FindProperty("_camera");
}

public override void OnInspectorGUI()
{
serializedObject.Update();
#if UNITY_5_6_OR_NEWER
serializedObject.UpdateIfRequiredOrScript();
#else
serializedObject.UpdateIfDirtyOrScript();
#endif

EditorGUILayout.PropertyField(layerName, TEXT_NAME);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(type);
if (EditorGUI.EndChangeCheck())
Expand All @@ -47,6 +55,8 @@ public override void OnInspectorGUI()
}

EditorGUILayout.LabelField(TEXT_HELP, GUIElements.HelpBox);

serializedObject.ApplyModifiedProperties();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal class StandardLayerEditor : UnityEditor.Editor
public static readonly GUIContent TEXT_ADVANCED_HEADER = new GUIContent("Advanced", "Advanced properties.");
public static readonly GUIContent TEXT_HIT_HEADER = new GUIContent("Hit test options", "Options which control what types of objects this layer should search under pointers.");

public static readonly GUIContent TEXT_NAME = new GUIContent("Name", "Layer name.");
public static readonly GUIContent TEXT_3D_OBJECTS = new GUIContent("Hit 3D Objects", "Layer should raycast 3D objects.");
public static readonly GUIContent TEXT_2D_OBJECTS = new GUIContent("Hit 2D Objects", "Layer should raycast 2D objects.");
public static readonly GUIContent TEXT_WORLD_UI = new GUIContent("Hit World UI", "Layer should raycast World Space UI.");
Expand All @@ -25,6 +26,7 @@ internal class StandardLayerEditor : UnityEditor.Editor
public static readonly GUIContent TEXT_HELP = new GUIContent("This component assigns target GameObjects in the scene for pressed pointers.");

private SerializedProperty advancedProps, hitProps;
private SerializedProperty layerName;
private SerializedProperty basicEditor;
private SerializedProperty hit3DObjects;
private SerializedProperty hit2DObjects;
Expand All @@ -39,6 +41,7 @@ protected virtual void OnEnable()

advancedProps = serializedObject.FindProperty("advancedProps");
hitProps = serializedObject.FindProperty("hitProps");
layerName = serializedObject.FindProperty("layerName");
basicEditor = serializedObject.FindProperty("basicEditor");
hit3DObjects = serializedObject.FindProperty("hit3DObjects");
hit2DObjects = serializedObject.FindProperty("hit2DObjects");
Expand Down Expand Up @@ -70,6 +73,7 @@ public override void OnInspectorGUI()
}
else
{
drawName();
drawHit();
drawAdvanced();
}
Expand All @@ -88,6 +92,11 @@ private void drawHit()
}
}

protected virtual void drawName()
{
EditorGUILayout.PropertyField(layerName, TEXT_NAME);
}

protected virtual void doDrawHit()
{
EditorGUILayout.PropertyField(hitScreenSpaceUI, TEXT_SS_UI);
Expand Down
22 changes: 15 additions & 7 deletions Source/Assets/TouchScript/Editor/TouchManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void OnEnable()
EditorGUI.LabelField(rect, "null");
return;
}
EditorGUI.LabelField(rect, layer.Name);
EditorGUI.LabelField(rect, layer.Name + " (" + layer.gameObject.name + ")");
};
}

Expand Down Expand Up @@ -207,7 +207,11 @@ private void drawSendMessage()
var label = EditorGUI.BeginProperty(r, TEXT_SEND_MESSAGE_EVENTS, sendMessageEvents);
EditorGUI.BeginChangeCheck();
r = EditorGUI.PrefixLabel(r, label);
#if UNITY_2017_3_OR_NEWER
var sMask = (TouchManager.MessageType) EditorGUI.EnumFlagsField(r, instance.SendMessageEvents);
#else
var sMask = (TouchManager.MessageType) EditorGUI.EnumMaskField(r, instance.SendMessageEvents);
#endif
if (EditorGUI.EndChangeCheck())
{
instance.SendMessageEvents = sMask;
Expand All @@ -232,12 +236,16 @@ private void refresh()
if (Application.isPlaying)
{
layers.arraySize = 0;
LayerManager.Instance.ForEach((l) =>
{
layers.arraySize++;
layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = l;
return true;
});
var layerManager = LayerManager.Instance;
if (layerManager != null)
{
LayerManager.Instance.ForEach((l) =>
{
layers.arraySize++;
layers.GetArrayElementAtIndex(layers.arraySize - 1).objectReferenceValue = l;
return true;
});
}
}
else
{
Expand Down
16 changes: 16 additions & 0 deletions Source/Assets/TouchScript/Editor/TouchScript-Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "TouchScript-Editor",
"references": [
"TouchScript"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void drawListElement(string header, string content, string url)
{
var rect = GUILayoutUtility.GetLastRect();
EditorGUIUtility.AddCursorRect(rect, MouseCursor.Link);
if (Event.current.type == EventType.mouseDown && rect.Contains(Event.current.mousePosition))
if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
Application.OpenURL(url);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,41 @@ namespace TouchScript.Editor.Utils.PropertyDrawers
[CustomPropertyDrawer(typeof(NullToggleAttribute))]
internal sealed class NullToggleDrawer : PropertyDrawer
{
private bool? expanded = null;
private class SharedData
{
internal bool expanded = false;
}

public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
updateExpanded(property);
if (expanded == false) return 16;
var data = updateExpanded(property);
if (data.expanded == false) return 16;
if (property.propertyType == SerializedPropertyType.ObjectReference && property.objectReferenceValue != null) return 16 * 3 + 2 * 2;
return 16 * 2 + 2;
}

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
updateExpanded(property);
var data = updateExpanded(property);

EditorGUIUtility.labelWidth = 60;
Begin(position, property, label);
if (expanded == false)
bool expandedChanged = Begin(data, position, property, label);
if (data.expanded == false)
{
switch (property.propertyType)
if (expandedChanged)
{
case SerializedPropertyType.ObjectReference:
property.objectReferenceValue = (Object) getNullValue(property);
break;
case SerializedPropertyType.Integer:
property.intValue = (int) getNullValue(property);
break;
case SerializedPropertyType.Float:
property.floatValue = (float) getNullValue(property);
break;
switch (property.propertyType)
{
case SerializedPropertyType.ObjectReference:
property.objectReferenceValue = (Object) getNullValue(property);
break;
case SerializedPropertyType.Integer:
property.intValue = (int) getNullValue(property);
break;
case SerializedPropertyType.Float:
property.floatValue = (float) getNullValue(property);
break;
}
}
}
else
Expand Down Expand Up @@ -70,88 +76,30 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
}
}
End();


// case SerializedPropertyType.Float:
// {
// EditorGUI.BeginChangeCheck();
// float floatValue = EditorGUI.FloatField(position, label, property.floatValue);
// if (EditorGUI.EndChangeCheck())
// {
// property.floatValue = floatValue;
// }
// break;
// }
// case SerializedPropertyType.String:
// {
// EditorGUI.BeginChangeCheck();
// string stringValue = EditorGUI.TextField(position, label, property.stringValue);
// if (EditorGUI.EndChangeCheck())
// {
// property.stringValue = stringValue;
// }
// break;
// }
// case SerializedPropertyType.Color:
// {
// EditorGUI.BeginChangeCheck();
// Color colorValue = EditorGUI.ColorField(position, label, property.colorValue);
// if (EditorGUI.EndChangeCheck())
// {
// property.colorValue = colorValue;
// }
// break;
// }
// case SerializedPropertyType.LayerMask:
// EditorGUI.LayerMaskField(position, property, label);
// break;
// case SerializedPropertyType.Enum:
// EditorGUI.Popup(position, property, label);
// break;
// case SerializedPropertyType.Vector2:
// EditorGUI.Vector2Field(position, property, label);
// break;
// case SerializedPropertyType.Vector3:
// EditorGUI.Vector3Field(position, property, label);
// break;
// case SerializedPropertyType.Rect:
// EditorGUI.RectField(position, property, label);
// break;
// case SerializedPropertyType.AnimationCurve:
// {
// int controlID = GUIUtility.GetControlID(EditorGUI.s_CurveHash, EditorGUIUtility.native, position);
// EditorGUI.DoCurveField(EditorGUI.PrefixLabel(position, controlID, label), controlID, null, EditorGUI.kCurveColor, default(Rect), property);
// break;
// }
// case SerializedPropertyType.Bounds:
// EditorGUI.BoundsField(position, property, label);
// break;
// case SerializedPropertyType.Gradient:
// {
// int controlID2 = GUIUtility.GetControlID(EditorGUI.s_CurveHash, EditorGUIUtility.native, position);
// EditorGUI.DoGradientField(EditorGUI.PrefixLabel(position, controlID2, label), controlID2, null, property);
// break;
// }
}

private void Begin(Rect position, SerializedProperty property, GUIContent label)
private bool Begin(SharedData data, Rect position, SerializedProperty property, GUIContent label)
{
label = EditorGUI.BeginProperty(position, label, property);
label.text = " " + label.text;
position.height = 16;
EditorGUIUtility.labelWidth = 180;
expanded = EditorGUI.ToggleLeft(position, label, expanded == true);
EditorGUI.BeginChangeCheck();
data.expanded = EditorGUI.ToggleLeft(position, label, data.expanded == true);
return EditorGUI.EndChangeCheck();
}

private void End()
{
EditorGUI.EndProperty();
}

private void updateExpanded(SerializedProperty property)
private SharedData updateExpanded(SerializedProperty property)
{
if (expanded != null) return;
expanded = !isNull(property);
var storage = SerializedPropertyUserData<SharedData>.Instance;
var data = storage[property];
if (data == null) storage[property] = data = new SharedData() { expanded = !isNull(property) };
return data;
}

private bool isNull(SerializedProperty property)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System.Collections.Generic;
using System.Text;
using UnityEditor;

namespace TouchScript.Editor.Utils
{
internal sealed class SerializedPropertyUserData<TUserData> where TUserData : class
{
public static SerializedPropertyUserData<TUserData> Instance { get { return instance; } }

private static SerializedPropertyUserData<TUserData> instance = new SerializedPropertyUserData<TUserData>();
private static StringBuilder sb = new StringBuilder();
private Dictionary<string, TUserData> storage = new Dictionary<string, TUserData>();

internal TUserData this[SerializedProperty property]
{
get
{
var key = MakeKey(property);
TUserData data;
if (!storage.TryGetValue(key, out data)) return null;
return data;
}
set
{
var key = MakeKey(property);
storage[key] = value;
}
}

private string MakeKey(SerializedProperty property)
{
if (property == null)
throw new System.ArgumentException();
var so = property.serializedObject;
if (so == null)
throw new System.ArgumentException();
var to = so.targetObject;
if (to == null)
throw new System.ArgumentException();
sb.Length = 0;
sb.Append(to.GetInstanceID().ToString());
sb.Append(property.propertyPath);
return sb.ToString();
}
}
}
Loading