add dictionary

master
tigerchen 6 years ago
parent f3697e11a5
commit 9a656f3b6c
  1. 43
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/RawImage.prefab
  2. 229
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  3. 66
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  4. 53
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs

@ -12,6 +12,8 @@ GameObject:
- component: {fileID: 2142686115215515799} - component: {fileID: 2142686115215515799}
- component: {fileID: 2142686115215515798} - component: {fileID: 2142686115215515798}
- component: {fileID: 2829506254029656376} - component: {fileID: 2829506254029656376}
- component: {fileID: 1996081109}
- component: {fileID: 1996081110}
m_Layer: 5 m_Layer: 5
m_Name: RawImage m_Name: RawImage
m_TagString: onFoot m_TagString: onFoot
@ -28,7 +30,7 @@ RectTransform:
m_GameObject: {fileID: 2142686115215515793} m_GameObject: {fileID: 2142686115215515793}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: -1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
@ -53,7 +55,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142686115215515793} m_GameObject: {fileID: 2142686115215515793}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name: m_Name:
@ -83,8 +85,39 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0a7db5ab031d8b640914e599456b9b21, type: 3} m_Script: {fileID: 11500000, guid: 0a7db5ab031d8b640914e599456b9b21, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
totalTime: 0.5
id: 0 id: 0
tuio_event: {fileID: 0} fade_speed: 0.05
fade_speed: 0.02
stat: 0 stat: 0
--- !u!114 &1996081109
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142686115215515793}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 03dae28dfe6734f4eb76c922ac72dd34, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 0
materials: []
attributeName:
targetObject: {fileID: 2142686115215515793}
--- !u!114 &1996081110
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142686115215515793}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 10f07b3f9fb96524db93eb42d89c229c, type: 3}
m_Name:
m_EditorClassIdentifier:
VideoAsset: {fileID: 11400000, guid: 232980c200b699741a54e99e165d86a2, type: 2}
LoadOnAwake: 1
PlayOnStart: 1
Looping: 1
AudioVolume: 0

@ -202,7 +202,7 @@ Transform:
m_LocalScale: {x: 2.585, y: 1, z: 1.2} m_LocalScale: {x: 2.585, y: 1, z: 1.2}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 2 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &299496350 --- !u!1 &299496350
GameObject: GameObject:
@ -294,153 +294,8 @@ Transform:
m_LocalScale: {x: 2.585, y: 1, z: 1.2} m_LocalScale: {x: 2.585, y: 1, z: 1.2}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &490275147
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 798465533}
m_Modifications:
- target: {fileID: 2142686115215515793, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_Name
value: RawImage
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515793, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_SizeDelta.x
value: 300
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_SizeDelta.y
value: 300
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: m_LocalScale.y
value: -1
objectReference: {fileID: 0}
- target: {fileID: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: tuio_event
value:
objectReference: {fileID: 914806966}
- target: {fileID: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: fade_speed
value: 0.05
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 8bbc036a3be21954681613cbe4f0e9a8, type: 3}
--- !u!224 &490275148 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 2142686115215515796, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
m_PrefabInstance: {fileID: 490275147}
m_PrefabAsset: {fileID: 0}
--- !u!1 &503604495 --- !u!1 &503604495
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -471,7 +326,7 @@ RectTransform:
m_LocalScale: {x: 1, y: -1, z: 1} m_LocalScale: {x: 1, y: -1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 798465533} m_Father: {fileID: 798465533}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -552,7 +407,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4472652550524646, guid: 1f68bf7cec2600e49a46d2f0554453c8, type: 3} - target: {fileID: 4472652550524646, guid: 1f68bf7cec2600e49a46d2f0554453c8, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 8 value: 9
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 4472652550524646, guid: 1f68bf7cec2600e49a46d2f0554453c8, type: 3} - target: {fileID: 4472652550524646, guid: 1f68bf7cec2600e49a46d2f0554453c8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
@ -690,7 +545,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 4 m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -764,7 +619,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 1 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &797223803 --- !u!1 &797223803
GameObject: GameObject:
@ -796,7 +651,7 @@ RectTransform:
m_LocalScale: {x: 1, y: -1, z: 1} m_LocalScale: {x: 1, y: -1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 798465533} m_Father: {fileID: 798465533}
m_RootOrder: 2 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -926,30 +781,17 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0}
m_Children: m_Children:
- {fileID: 490275148}
- {fileID: 503604496} - {fileID: 503604496}
- {fileID: 797223804} - {fileID: 797223804}
- {fileID: 1959362813} - {fileID: 1959362813}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 6 m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
--- !u!114 &846725642 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114218046520840180, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
m_PrefabInstance: {fileID: 513889829}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cdf0798800151dc4e813b97f862d3d10, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &914806964 --- !u!1 &914806964
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -979,7 +821,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 9 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &914806966 --- !u!114 &914806966
MonoBehaviour: MonoBehaviour:
@ -993,10 +835,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e7eda42473bde25468ccb55d2b565cf9, type: 3} m_Script: {fileID: 11500000, guid: e7eda42473bde25468ccb55d2b565cf9, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
img: {fileID: 1996081105} img: {fileID: 2142686115215515793, guid: 8bbc036a3be21954681613cbe4f0e9a8, type: 3}
canvas: {fileID: 798465529} canvas: {fileID: 798465533}
tuio_input: {fileID: 846725642}
isLocked: 0
--- !u!1 &963194225 --- !u!1 &963194225
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1078,7 +918,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &963194229 --- !u!114 &963194229
MonoBehaviour: MonoBehaviour:
@ -1165,7 +1005,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 5 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1203,7 +1043,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 798465533} m_Father: {fileID: 798465533}
m_RootOrder: 3 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5}
@ -1259,45 +1099,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1959362812} m_GameObject: {fileID: 1959362812}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &1996081105 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2142686115215515793, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
m_PrefabInstance: {fileID: 490275147}
m_PrefabAsset: {fileID: 0}
--- !u!114 &1996081109
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1996081105}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 03dae28dfe6734f4eb76c922ac72dd34, type: 3}
m_Name:
m_EditorClassIdentifier:
target: 0
materials: []
attributeName:
targetObject: {fileID: 1996081105}
--- !u!114 &1996081110
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1996081105}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 10f07b3f9fb96524db93eb42d89c229c, type: 3}
m_Name:
m_EditorClassIdentifier:
VideoAsset: {fileID: 11400000, guid: 232980c200b699741a54e99e165d86a2, type: 2}
LoadOnAwake: 1
PlayOnStart: 1
Looping: 1
AudioVolume: 0
--- !u!1 &2044104306 --- !u!1 &2044104306
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1378,5 +1179,5 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 7 m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

@ -7,95 +7,93 @@ using UltraCombos;
public class movieController : MonoBehaviour public class movieController : MonoBehaviour
{ {
//[RequireComponent(typeof(DShowMoviePlayer))]
DShowMoviePlayer player; DShowMoviePlayer player;
public int id; public int id;
public tuio_event tuio_event; //public tuio_event tuio_event;
public float fade_speed = 0.02f; public float fade_speed = 0.02f;
public int stat; public int stat;
float c; float c;
Vector2 pos, pre_pos; //Vector2 pos, pre_pos;
bool first_time = false; //public Transform trans;
void Awake() void Awake()
{ {
player = GetComponent<DShowMoviePlayer>(); player = GetComponent<DShowMoviePlayer>();
//trans = GetComponent<Transform>();
} }
void Start() void Start()
{ {
//player = GetComponent<DShowMoviePlayer>(); //player = GetComponent<DShowMoviePlayer>();
GetComponent<RawImage>().color = Color.clear; GetComponent<RawImage>().color = Color.clear;
pos = Vector2.zero; //pos = Vector2.zero;
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
#if false
transform.gameObject.SetActive(true);
trans = GetComponent<Transform>();
//Debug.Log(stat); //Debug.Log(stat);
pre_pos = pos; pre_pos = pos;
if (name == "RawImage") if (tuio_event.tuio_input.touchCount > 0 && id != -1)
{
GetComponent<RawImage>().enabled = false;
}
else
{
GetComponent<RawImage>().enabled = true;
}
bool _isLocked = tuio_event.isLocked;
if (tuio_event.tuio_input.touchCount > 0 && _isLocked == false && id != -1)
{ {
transform.gameObject.SetActive(true); transform.gameObject.SetActive(true);
////////////////////// //////////////////////
///
/*
int t_c = tuio_event.tuio_input.touchCount; int t_c = tuio_event.tuio_input.touchCount;
if (id == t_c) if (id == t_c)
{ {
id -= 1; //id -= 1;
Debug.Log("error"); Debug.Log("error");
} }
//Debug.Log("id = " + id + " / touch count = " + t_c); //Debug.Log("id = " + id + " / touch count = " + t_c);
if (stat == 1 && id >= 0 && id < t_c) if (id >= 0)
{ {
pos = tuio_event.tuio_input.GetTouch(id).position; pos = tuio_event.tuio_input.GetTouch(id).position;
} }
else if (stat == 2) else
pos = pre_pos; pos = pre_pos;
GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0); GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
*/
} }
if(stat == 1) #endif
if (stat == 1)
{ {
c += fade_speed; c += fade_speed;
} if(c > 1)
else if (stat == 2)
{ {
c -= fade_speed; c = 1;
if (c < 0f) Destroy(gameObject); stat = 2;
} }
c = Mathf.Clamp(c, 0f, 1f);
GetComponent<RawImage>().color = new Color(1f, 1f, 1f, c); GetComponent<RawImage>().color = new Color(1f, 1f, 1f, c);
} }
}
void OnEnable() void OnEnable()
{ {
Debug.Log("Hi"); if (name != "RawImage") {
GetComponent<RawImage>().enabled = true;
}
//Debug.Log("Hi");
//Debug.Log(id.ToString());
stat = 1; stat = 1;
//c = 0f; c = 0f;
if (first_time == false)
{
Vector3 rot_axis = new Vector3(0, 0, 1); Vector3 rot_axis = new Vector3(0, 0, 1);
Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0); Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0);
float rand_deg = Random.Range(0, 360); float rand_deg = Random.Range(0, 360);
//GetComponent<RectTransform>().Rotate(rot_axis, rand_deg); GetComponent<RectTransform>().Rotate(rot_axis, rand_deg);
}
first_time = true;
} }
void OnDestroy() void OnDestroy()
{ {
Debug.Log("Bye"); //Debug.Log("Bye");
player.Stop();
} }
} }

@ -4,11 +4,53 @@ using UnityEngine;
public class tuio_event : MonoBehaviour public class tuio_event : MonoBehaviour
{ {
#if true
public GameObject img;
public Transform canvas;
//public UltraCombos.GlobalMKHookInput tuio_input;
Dictionary<int, movieController> movies = new Dictionary<int, movieController>();
void Update()
{
var touches = TUIOManager.Instance.touches;
foreach (var id in touches.Keys)
{
movieController movie = null;
if (movies.ContainsKey(id) == false) // Add
{
Debug.Log("Add");
GameObject g = Instantiate(img, canvas);
g.name = id.ToString();
movie = g.AddComponent<movieController>();
movie.id = id;
movies.Add(id, movie);
}
else //update
movie = movies[id];
//update or after adding
//Debug.Log("Update");
movie.transform.position = touches[id].position;
}
var removes = new HashSet<int>();
foreach (var id in movies.Keys)
{
if (touches.ContainsKey(id) == false) // remove
{
Debug.Log("Remove");
Destroy(movies[id].gameObject);
//movies.Remove(id);
removes.Add(id);
}
}
foreach (var id in removes)
movies.Remove(id);
}
#else
// Start is called before the first frame update // Start is called before the first frame update
public GameObject img; public GameObject img;
public GameObject canvas; public GameObject canvas;
public UltraCombos.GlobalMKHookInput tuio_input; public UltraCombos.GlobalMKHookInput tuio_input;
public bool isLocked;
List<int> cur_ids = new List<int>(); List<int> cur_ids = new List<int>();
List<int> pre_ids = new List<int>(); List<int> pre_ids = new List<int>();
@ -21,9 +63,9 @@ public class tuio_event : MonoBehaviour
cur_count = 0; cur_count = 0;
} }
// Update is called once per frame
void Update() void Update()
{ {
reset_id();
pre_count = cur_count; pre_count = cur_count;
pre_ids.Clear(); pre_ids.Clear();
cur_ids.ForEach(i => pre_ids.Add(i)); cur_ids.ForEach(i => pre_ids.Add(i));
@ -53,22 +95,21 @@ public class tuio_event : MonoBehaviour
} }
else if (cur_count < pre_count) // Remove else if (cur_count < pre_count) // Remove
{ {
isLocked = true;
//Debug.Log("Remove"); //Debug.Log("Remove");
int exit_id;
for (int i = 0; i < pre_count; i++) for (int i = 0; i < pre_count; i++)
{ {
int _id = pre_ids[i]; int _id = pre_ids[i];
bool isExitTouch = !cur_ids.Contains(_id); bool isExitTouch = !cur_ids.Contains(_id);
if (isExitTouch) if (isExitTouch)
{ {
exit_id = _id;
//GameObject.Find(_id.ToString()).GetComponent<movieController>().stat = 2; //GameObject.Find(_id.ToString()).GetComponent<movieController>().stat = 2;
Destroy(GameObject.Find(_id.ToString())); Destroy(GameObject.Find(_id.ToString()));
} }
} }
} }
reset_id(); reset_id();
isLocked = false;
Debug.Log(GameObject.Find("RawImage").GetComponent<movieController>().id);
} }
void reset_id() void reset_id()
@ -78,6 +119,8 @@ public class tuio_event : MonoBehaviour
for (int i = 0; i < objs.Length; i++) for (int i = 0; i < objs.Length; i++)
{ {
objs[i].GetComponent<movieController>().id = i - 1; objs[i].GetComponent<movieController>().id = i - 1;
Debug.Log(objs[i].name + " / id = " + objs[i].GetComponent<movieController>().id.ToString());
} }
} }
#endif
} }

Loading…
Cancel
Save