add debug message & render texture

master
tigerchen 6 years ago
parent 1de9cdac87
commit b75e9a179a
  1. 82
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  2. 35
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  3. 10
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs
  4. 34
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Textures/TUIO_DebugTex.renderTexture
  5. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Textures/TUIO_DebugTex.renderTexture.meta
  6. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/New UltraCombos.DShowClip.asset

@ -308,6 +308,11 @@ PrefabInstance:
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
@ -423,6 +428,11 @@ PrefabInstance:
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
@ -920,7 +930,6 @@ RectTransform:
- {fileID: 503604496}
- {fileID: 797223804}
- {fileID: 1959362813}
- {fileID: 1294630123}
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -987,6 +996,7 @@ MonoBehaviour:
img: {fileID: 1996081105}
canvas: {fileID: 798465529}
tuio_input: {fileID: 846725642}
isLocked: 0
--- !u!1 &963194225
GameObject:
m_ObjectHideFlags: 0
@ -1083,76 +1093,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
_clearAlpha: 1
--- !u!1 &1294630122
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1294630123}
- component: {fileID: 1294630125}
- component: {fileID: 1294630124}
m_Layer: 5
m_Name: RawImage (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1294630123
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1294630122}
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: 4
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: 600}
m_SizeDelta: {x: 2527, y: 1200}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1294630124
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1294630122}
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: 8400000, guid: e567e88d5f268114c873ccbdd25b0557, type: 2}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &1294630125
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1294630122}
m_CullTransparentMesh: 0
--- !u!1 &1395462205
GameObject:
m_ObjectHideFlags: 0

@ -9,13 +9,13 @@ public class movieController : MonoBehaviour
{
//[RequireComponent(typeof(DShowMoviePlayer))]
DShowMoviePlayer player;
public float totalTime = 0.5f;
public int id;
public tuio_event tuio_event;
public float fade_speed = 0.02f;
public int stat;
float c;
Vector2 pos, pre_pos;
bool first_time = false;
void Awake()
{
@ -44,11 +44,23 @@ public class movieController : MonoBehaviour
GetComponent<RawImage>().enabled = true;
}
if (tuio_event.tuio_input.touchCount > 0)
bool _isLocked = tuio_event.isLocked;
if (tuio_event.tuio_input.touchCount > 0 && _isLocked == false && id != -1)
{
transform.gameObject.SetActive(true);
if (stat == 1 && id >= 0)
//////////////////////
int t_c = tuio_event.tuio_input.touchCount;
if (id == t_c)
{
id -= 1;
Debug.Log("error");
}
//Debug.Log("id = " + id + " / touch count = " + t_c);
if (stat == 1 && id >= 0 && id < t_c)
{
pos = tuio_event.tuio_input.GetTouch(id).position;
}
else if (stat == 2)
pos = pre_pos;
GetComponent<RectTransform>().position = new Vector3(pos.x, pos.y, 0);
@ -66,15 +78,22 @@ public class movieController : MonoBehaviour
GetComponent<RawImage>().color = new Color(1f, 1f, 1f, c);
}
private void OnEnable()
void OnEnable()
{
stat = 1;
c = 0f;
Debug.Log("Hi");
player.Frame = (uint)Random.Range(0, player.TotalNumFrames);
stat = 1;
//c = 0f;
if (first_time == false)
{
Vector3 rot_axis = new Vector3(0, 0, 1);
Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0);
float rand_deg = Random.Range(0, 360);
//GetComponent<RectTransform>().Rotate(rot_axis, rand_deg);
}
first_time = true;
}
private void OnDestroy()
void OnDestroy()
{
Debug.Log("Bye");
player.Stop();

@ -8,6 +8,7 @@ public class tuio_event : MonoBehaviour
public GameObject img;
public GameObject canvas;
public UltraCombos.GlobalMKHookInput tuio_input;
public bool isLocked;
List<int> cur_ids = new List<int>();
List<int> pre_ids = new List<int>();
@ -40,18 +41,19 @@ public class tuio_event : MonoBehaviour
//Debug.Log("Add");
for (int i = 0; i < cur_count; i++)
{
int _id = tuio_input.GetTouch(i).fingerId;
bool isOldTouch = pre_ids.Contains(_id);
int f_id = tuio_input.GetTouch(i).fingerId;
bool isOldTouch = pre_ids.Contains(f_id);
if (isOldTouch == false)
{
GameObject g = Instantiate(img, canvas.GetComponent<Transform>());
g.name = _id.ToString();
g.name = f_id.ToString();
//g.GetComponent<movieController>().id = i;
}
}
}
else if (cur_count < pre_count) // Remove
{
isLocked = true;
//Debug.Log("Remove");
for (int i = 0; i < pre_count; i++)
{
@ -65,6 +67,8 @@ public class tuio_event : MonoBehaviour
}
}
reset_id();
isLocked = false;
Debug.Log(GameObject.Find("RawImage").GetComponent<movieController>().id);
}
void reset_id()

@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TUIO_DebugTex
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
m_Width: 1920
m_Height: 1200
m_AntiAliasing: 1
m_DepthFormat: 2
m_ColorFormat: 0
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e567e88d5f268114c873ccbdd25b0557
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: New UltraCombos.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Material\Video_buttombracket.avi
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Material\1928-01-D.avi
animationClip: {fileID: 0}

Loading…
Cancel
Save