Add List & prefab

master
tigerchen 6 years ago
parent b8433f2bdd
commit 1445632204
  1. 8
      Unity-19050-08-DarkSea/Assets/Prefabs.meta
  2. 88
      Unity-19050-08-DarkSea/Assets/Prefabs/RawImage.prefab
  3. 7
      Unity-19050-08-DarkSea/Assets/Prefabs/RawImage.prefab.meta
  4. 379
      Unity-19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  5. 32
      Unity-19050-08-DarkSea/Assets/Scripts/ScaleActivity.cs
  6. 60
      Unity-19050-08-DarkSea/Assets/Scripts/movieController.cs
  7. 2
      Unity-19050-08-DarkSea/Assets/Scripts/movieController.cs.meta
  8. 65
      Unity-19050-08-DarkSea/Assets/Scripts/tuio_event.cs

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1e76c375938ec5844a0b11073e6f9da4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,88 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2142686115215515793
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2142686115215515796}
- component: {fileID: 2142686115215515799}
- component: {fileID: 2142686115215515798}
- component: {fileID: 2829506254029656376}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2142686115215515796
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142686115215515793}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 300, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2142686115215515799
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2142686115215515793}
m_CullTransparentMesh: 0
--- !u!114 &2142686115215515798
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: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!114 &2829506254029656376
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: 0a7db5ab031d8b640914e599456b9b21, type: 3}
m_Name:
m_EditorClassIdentifier:
totalTime: 0.5
id: 0
tuio_event: {fileID: 0}

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8bbc036a3be21954681613cbe4f0e9a8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -296,6 +296,136 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 3
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: 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: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
propertyPath: tuio_event
value:
objectReference: {fileID: 914806966}
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
GameObject:
m_ObjectHideFlags: 0
@ -326,7 +456,7 @@ RectTransform:
m_LocalScale: {x: 1, y: -1, z: 1}
m_Children: []
m_Father: {fileID: 798465533}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -366,93 +496,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 503604495}
m_CullTransparentMesh: 0
--- !u!1 &508356619
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 508356622}
- component: {fileID: 508356621}
- component: {fileID: 508356620}
- component: {fileID: 508356623}
m_Layer: 5
m_Name: RawImage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &508356620
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 508356619}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -98529514, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 0}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &508356621
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 508356619}
m_CullTransparentMesh: 0
--- !u!224 &508356622
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 508356619}
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_Children: []
m_Father: {fileID: 798465533}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 300, y: 300}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &508356623
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 508356619}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f2f060315d279d141a05deb0236dde0e, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates: []
articulatingActivities: []
introTime: 0.5
outroTime: 0.5
--- !u!1001 &513889829
PrefabInstance:
m_ObjectHideFlags: 0
@ -527,7 +570,7 @@ PrefabInstance:
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1221340186}
objectReference: {fileID: 0}
- target: {fileID: 114540009425154000, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
@ -542,7 +585,7 @@ PrefabInstance:
type: 3}
propertyPath: RemoveTuioBlobEvent.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgument
value:
objectReference: {fileID: 1056573855}
objectReference: {fileID: 0}
- target: {fileID: 114872970294644716, guid: 1f68bf7cec2600e49a46d2f0554453c8,
type: 3}
propertyPath: customRoi.width
@ -738,7 +781,7 @@ RectTransform:
m_LocalScale: {x: 1, y: -1, z: 1}
m_Children: []
m_Father: {fileID: 798465533}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -868,9 +911,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 490275148}
- {fileID: 503604496}
- {fileID: 797223804}
- {fileID: 508356622}
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -934,11 +977,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e7eda42473bde25468ccb55d2b565cf9, type: 3}
m_Name:
m_EditorClassIdentifier:
img: {fileID: 508356619}
img: {fileID: 1996081105}
canvas: {fileID: 798465529}
tuio_input: {fileID: 846725642}
act_pool: {fileID: 1221340186}
act_in: {fileID: 1136321091}
act_out: {fileID: 1056573855}
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
@ -964,7 +1005,7 @@ AudioListener:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 1
m_Enabled: 0
--- !u!20 &963194227
Camera:
m_ObjectHideFlags: 0
@ -1021,144 +1062,6 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1056573853
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1056573854}
- component: {fileID: 1056573855}
m_Layer: 0
m_Name: State_out
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1056573854
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1056573853}
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_Children: []
m_Father: {fileID: 1221340187}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1056573855
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1056573853}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2af6d95f21a93714e944186ff0e29f68, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates: []
articulatingActivities:
- {fileID: 0}
--- !u!1 &1136321089
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1136321090}
- component: {fileID: 1136321091}
m_Layer: 0
m_Name: State_in
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &1136321090
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1136321089}
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_Children: []
m_Father: {fileID: 1221340187}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1136321091
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1136321089}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2af6d95f21a93714e944186ff0e29f68, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Delegates: []
articulatingActivities:
- {fileID: 0}
--- !u!1 &1221340185
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1221340187}
- component: {fileID: 1221340186}
m_Layer: 0
m_Name: Activity Pool
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1221340186
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221340185}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bc899c78f8612294097669c6627e2b0f, type: 3}
m_Name:
m_EditorClassIdentifier:
_current: {fileID: 1056573855}
--- !u!4 &1221340187
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1221340185}
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_Children:
- {fileID: 1136321090}
- {fileID: 1056573854}
m_Father: {fileID: 0}
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1395462205
GameObject:
m_ObjectHideFlags: 0
@ -1238,6 +1141,12 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1996081105 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2142686115215515793, guid: 8bbc036a3be21954681613cbe4f0e9a8,
type: 3}
m_PrefabInstance: {fileID: 490275147}
m_PrefabAsset: {fileID: 0}
--- !u!1 &2044104306
GameObject:
m_ObjectHideFlags: 0

@ -1,32 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UltraCombos;
public class ScaleActivity : Activity
{
public float introTime = 1;
public float outroTime = 1;
protected override IEnumerator OnEnter()
{
yield return DoScaling( 1, introTime);
}
protected override IEnumerator OnLeave()
{
yield return DoScaling( 0, outroTime);
}
IEnumerator DoScaling( float to, float totalTime)
{
float from = transform.localScale.x;
float scale = from;
float startTime = Time.time;
while (scale != to)
{
float duration = Time.time - startTime;
scale = Mathf.Lerp(from, to, duration / totalTime);
transform.localScale = new Vector3(scale, scale, 1);
yield return null;
}
yield break;
}
}

@ -0,0 +1,60 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class movieController : MonoBehaviour
{
public float totalTime = 0.5f;
public int id;
public tuio_event tuio_event;
//public Transform trans;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if(name == "RawImage")
{
GetComponent<RawImage>().enabled = false;
}
else
{
GetComponent<RawImage>().enabled = true;
}
if (tuio_event.tuio_input.touchCount > 0)
{
transform.gameObject.SetActive(true);
Vector2 pos = tuio_event.tuio_input.GetTouch(id).position;
GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
}
}
void wake()
{
doScaling(1);
}
void die()
{
doScaling(0);
Destroy(this);
}
void doScaling(float to)
{
float from = transform.localScale.x;
float scale = from;
float startTime = Time.time;
while (scale != to)
{
float duration = Time.time - startTime;
scale = Mathf.Lerp(from, to, duration / totalTime);
transform.localScale = new Vector3(scale, scale, 1);
}
}
}

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f2f060315d279d141a05deb0236dde0e
guid: 0a7db5ab031d8b640914e599456b9b21
MonoImporter:
externalObjects: {}
serializedVersion: 2

@ -6,30 +6,69 @@ public class tuio_event : MonoBehaviour
{
// Start is called before the first frame update
public GameObject img;
public GameObject canvas;
public UltraCombos.GlobalMKHookInput tuio_input;
public UltraCombos.ActivityPool act_pool;
public UltraCombos.Activity act_in;
public UltraCombos.Activity act_out;
List<int> cur_ids = new List<int>();
List<int> pre_ids = new List<int>();
int pre_count;
int cur_count;
void Start()
{
cur_count = 0;
}
// Update is called once per frame
void Update()
{
int c = tuio_input.touchCount;
Debug.Log(c);
if(c > 0)
if (Input.GetKeyDown(KeyCode.K))
{
Destroy(GameObject.Find("eee"));
}
pre_count = cur_count;
pre_ids.Clear();
cur_ids.ForEach(i => pre_ids.Add(i));
cur_count = tuio_input.touchCount;
cur_ids.Clear();
for (int i = 0; i < cur_count; i++)
{
cur_ids.Add(tuio_input.GetTouch(i).fingerId);
}
if (cur_count > pre_count) // Add
{
act_pool.SwitchTo(act_in);
Vector2 pos = tuio_input.GetTouch(0).position;
img.GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
} else
//Debug.Log("Add");
for (int i = 0; i < cur_count; i++)
{
int _id = tuio_input.GetTouch(i).fingerId;
bool isOldTouch = pre_ids.Contains(_id);
if (isOldTouch == false)
{
GameObject g = Instantiate(img, canvas.GetComponent<Transform>());
g.name = _id.ToString();
g.GetComponent<movieController>().id = i;
}
}
}
else if (cur_count < pre_count) // Remove
{
act_pool.SwitchTo(act_out);
//Debug.Log("Remove");
for (int i = 0; i < pre_count; i++)
{
int _id = pre_ids[i];
bool isExitTouch = cur_ids.Contains(_id);
if (isExitTouch == false)
{
Destroy(GameObject.Find(_id.ToString()));
}
}
}
//Vector2 pos = tuio_input.GetTouch(0).position;
//img.GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
}
}

Loading…
Cancel
Save