Skip to content

Commit dd9c029

Browse files
authored
Merge pull request #189 from watson-developer-cloud/feature-188-updateTouchScript
Fixed issue 188
2 parents b39b042 + eaee324 commit dd9c029

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1695
-759
lines changed

Config.json.enc

0 Bytes
Binary file not shown.

Prefabs/TouchManager.prefab

100755100644
Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ GameObject:
55
m_ObjectHideFlags: 0
66
m_PrefabParentObject: {fileID: 0}
77
m_PrefabInternal: {fileID: 100100000}
8-
serializedVersion: 4
8+
serializedVersion: 5
99
m_Component:
10-
- 4: {fileID: 456440}
11-
- 114: {fileID: 11447296}
12-
- 114: {fileID: 11482954}
13-
- 114: {fileID: 11437114}
14-
- 114: {fileID: 11479124}
15-
- 114: {fileID: 11457544}
16-
- 114: {fileID: 11469728}
17-
- 114: {fileID: 11459306}
18-
- 114: {fileID: 11461230}
19-
- 114: {fileID: 11479102}
20-
- 114: {fileID: 11417566}
21-
- 114: {fileID: 11495534}
10+
- component: {fileID: 456440}
11+
- component: {fileID: 11447296}
12+
- component: {fileID: 11482954}
13+
- component: {fileID: 11437114}
14+
- component: {fileID: 11479124}
15+
- component: {fileID: 11457544}
16+
- component: {fileID: 11469728}
17+
- component: {fileID: 11459306}
18+
- component: {fileID: 11461230}
19+
- component: {fileID: 11479102}
20+
- component: {fileID: 11417566}
21+
- component: {fileID: 11495534}
2222
m_Layer: 0
2323
m_Name: TouchManager
2424
m_TagString: Untagged
@@ -31,10 +31,10 @@ GameObject:
3131
m_ObjectHideFlags: 0
3232
m_PrefabParentObject: {fileID: 0}
3333
m_PrefabInternal: {fileID: 100100000}
34-
serializedVersion: 4
34+
serializedVersion: 5
3535
m_Component:
36-
- 4: {fileID: 438902}
37-
- 114: {fileID: 11412284}
36+
- component: {fileID: 438902}
37+
- component: {fileID: 11412284}
3838
m_Layer: 0
3939
m_Name: Inputs
4040
m_TagString: Untagged
@@ -47,11 +47,11 @@ GameObject:
4747
m_ObjectHideFlags: 0
4848
m_PrefabParentObject: {fileID: 0}
4949
m_PrefabInternal: {fileID: 100100000}
50-
serializedVersion: 4
50+
serializedVersion: 5
5151
m_Component:
52-
- 224: {fileID: 22440388}
53-
- 114: {fileID: 11455964}
54-
- 223: {fileID: 22308338}
52+
- component: {fileID: 22440388}
53+
- component: {fileID: 11455964}
54+
- component: {fileID: 22308338}
5555
m_Layer: 0
5656
m_Name: Touch Visualizer Watson
5757
m_TagString: Untagged
@@ -68,10 +68,10 @@ Transform:
6868
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
6969
m_LocalPosition: {x: 0, y: 0, z: 0}
7070
m_LocalScale: {x: 1, y: 1, z: 1}
71-
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
7271
m_Children: []
7372
m_Father: {fileID: 456440}
7473
m_RootOrder: 0
74+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
7575
--- !u!4 &456440
7676
Transform:
7777
m_ObjectHideFlags: 1
@@ -81,12 +81,12 @@ Transform:
8181
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
8282
m_LocalPosition: {x: 0, y: 0, z: 0}
8383
m_LocalScale: {x: 1, y: 1, z: 1}
84-
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
8584
m_Children:
8685
- {fileID: 438902}
8786
- {fileID: 22440388}
8887
m_Father: {fileID: 0}
8988
m_RootOrder: 0
89+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
9090
--- !u!114 &11412284
9191
MonoBehaviour:
9292
m_ObjectHideFlags: 1
@@ -351,7 +351,8 @@ MonoBehaviour:
351351
useSendMessage: 0
352352
sendMessageEvents: 60
353353
sendMessageTarget: {fileID: 0}
354-
layers: []
354+
layers:
355+
- {fileID: 0}
355356
--- !u!114 &11495534
356357
MonoBehaviour:
357358
m_ObjectHideFlags: 1
@@ -403,10 +404,10 @@ RectTransform:
403404
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
404405
m_LocalPosition: {x: 0, y: 0, z: 0}
405406
m_LocalScale: {x: 0, y: 0, z: 0}
406-
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
407407
m_Children: []
408408
m_Father: {fileID: 456440}
409409
m_RootOrder: 1
410+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
410411
m_AnchorMin: {x: 0, y: 0}
411412
m_AnchorMax: {x: 0, y: 0}
412413
m_AnchoredPosition: {x: 0, y: 0}

ThirdParty/TouchScript/Editor/Gestures/GestureEditor.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ protected virtual void drawLimitTouches()
151151
minTouchesFloat = 0;
152152
maxTouchesFloat = 10;
153153
}
154+
else
155+
{
156+
minTouchesFloat = (float) minTouches.intValue;
157+
maxTouchesFloat = (float) maxTouches.intValue;
158+
}
159+
//or this values doesn't change from script properly
154160
EditorGUI.indentLevel++;
155161
EditorGUILayout.LabelField("Min: " + (int)minTouchesFloat + ", Max: " + (int)maxTouchesFloat);
156162
EditorGUILayout.MinMaxSlider(ref minTouchesFloat, ref maxTouchesFloat, 0, 10);
@@ -338,4 +344,4 @@ private void removeFromArray(SerializedProperty array, int index)
338344

339345
#endregion
340346
}
341-
}
347+
}

ThirdParty/TouchScript/Modules.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ThirdParty/TouchScript/Modules/TUIO.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ThirdParty/TouchScript/Modules/TUIO/Editor/InputSources.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
using TouchScript.InputSources;
2+
using UnityEditor;
3+
using UnityEditorInternal;
4+
using UnityEngine;
5+
6+
namespace TouchScript.Editor.InputSources
7+
{
8+
[CustomEditor(typeof(TuioInput), true)]
9+
internal sealed class TuioInputEditor : InputSourceEditor
10+
{
11+
private static readonly GUIContent INPUT_TYPES = new GUIContent("Input Types", "Supported input types.");
12+
private static readonly GUIContent OBJECT_MAPPINGS = new GUIContent("TUIO Object Mappings", "TUIO Object to Tag list.");
13+
14+
private TuioInput instance;
15+
private SerializedProperty supportedInputs, tuioObjectMappings;
16+
private SerializedProperty cursorTags, blobTags, objectTags;
17+
private SerializedProperty tuioPort;
18+
private ReorderableList list;
19+
20+
protected override void OnEnable()
21+
{
22+
base.OnEnable();
23+
24+
instance = target as TuioInput;
25+
supportedInputs = serializedObject.FindProperty("supportedInputs");
26+
tuioObjectMappings = serializedObject.FindProperty("tuioObjectMappings");
27+
cursorTags = serializedObject.FindProperty("cursorTags");
28+
blobTags = serializedObject.FindProperty("blobTags");
29+
objectTags = serializedObject.FindProperty("objectTags");
30+
tuioPort = serializedObject.FindProperty("tuioPort");
31+
32+
list = new ReorderableList(serializedObject, tuioObjectMappings, false, true, true, true);
33+
list.drawHeaderCallback += rect => GUI.Label(rect, OBJECT_MAPPINGS);
34+
list.drawElementCallback += (rect, index, active, focused) =>
35+
{
36+
EditorGUI.BeginChangeCheck();
37+
var element = instance.TuioObjectMappings[index];
38+
rect.height = 16;
39+
rect.y += 2;
40+
var r = rect;
41+
r.width = 20;
42+
GUI.Label(r, "id:");
43+
r.x += r.width;
44+
r.width = 50;
45+
var newId = EditorGUI.IntField(r, element.Id);
46+
r.x += r.width;
47+
r.width = 40;
48+
GUI.Label(r, " tag:");
49+
r.x += r.width;
50+
r.width = rect.width - r.x + rect.x;
51+
var newTag = GUI.TextField(r, element.Tag);
52+
53+
if (EditorGUI.EndChangeCheck())
54+
{
55+
element.Id = newId;
56+
element.Tag = newTag;
57+
EditorUtility.SetDirty(target);
58+
}
59+
};
60+
}
61+
62+
public override void OnInspectorGUI()
63+
{
64+
serializedObject.UpdateIfDirtyOrScript();
65+
66+
EditorGUILayout.PropertyField(tuioPort);
67+
68+
var r = EditorGUILayout.GetControlRect(true, 16f, EditorStyles.layerMaskField);
69+
var label = EditorGUI.BeginProperty(r, INPUT_TYPES, supportedInputs);
70+
EditorGUI.BeginChangeCheck();
71+
r = EditorGUI.PrefixLabel(r, label);
72+
var sMask = (TuioInput.InputType)EditorGUI.EnumMaskField(r, instance.SupportedInputs);
73+
if (EditorGUI.EndChangeCheck())
74+
{
75+
instance.SupportedInputs = sMask;
76+
EditorUtility.SetDirty(instance);
77+
}
78+
EditorGUI.EndProperty();
79+
80+
if ((sMask & TuioInput.InputType.Objects) != 0)
81+
{
82+
list.DoLayoutList();
83+
}
84+
85+
serializedObject.ApplyModifiedProperties();
86+
base.OnInspectorGUI();
87+
}
88+
89+
protected override void drawAdvanced()
90+
{
91+
EditorGUI.indentLevel++;
92+
EditorGUILayout.PropertyField(cursorTags);
93+
EditorGUILayout.PropertyField(blobTags);
94+
EditorGUILayout.PropertyField(objectTags);
95+
EditorGUI.indentLevel--;
96+
}
97+
}
98+
}

ThirdParty/TouchScript/Modules/TUIO/Editor/InputSources/TuioInputEditor.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ThirdParty/TouchScript/Modules/TUIO/Libraries.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

ThirdParty/TouchScript/Modules/TUIO/Libraries/OSCsharp.dll.meta

Lines changed: 78 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

0 commit comments

Comments
 (0)