|
|
|
@ -12,7 +12,7 @@ public class tuio_event : MonoBehaviour |
|
|
|
Dictionary<int, Vector2> pre_pos = new Dictionary<int, Vector2>(); |
|
|
|
Dictionary<int, Vector2> pre_pos = new Dictionary<int, Vector2>(); |
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
[Config] |
|
|
|
public bool VisualizeTouches = true; |
|
|
|
public bool VisualizeTouches = false; |
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
[Config] |
|
|
|
[Range(1, 30)] |
|
|
|
[Range(1, 30)] |
|
|
|
@ -23,7 +23,7 @@ public class tuio_event : MonoBehaviour |
|
|
|
public int delta_threshold = 100; |
|
|
|
public int delta_threshold = 100; |
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
[Config] |
|
|
|
[Range(128, 512)] |
|
|
|
[Range(128, 1024)] |
|
|
|
public int snow_size = 256; |
|
|
|
public int snow_size = 256; |
|
|
|
|
|
|
|
|
|
|
|
[Config] |
|
|
|
[Config] |
|
|
|
@ -35,8 +35,8 @@ public class tuio_event : MonoBehaviour |
|
|
|
public float img_wait_sec = 2f; |
|
|
|
public float img_wait_sec = 2f; |
|
|
|
|
|
|
|
|
|
|
|
//[Config] |
|
|
|
//[Config] |
|
|
|
[Range(0f, 1f)] |
|
|
|
//[Range(0f, 1f)] |
|
|
|
public float audio_volume = 1f; |
|
|
|
//public float audio_volume = 1f; |
|
|
|
|
|
|
|
|
|
|
|
void Update() |
|
|
|
void Update() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -45,7 +45,6 @@ public class tuio_event : MonoBehaviour |
|
|
|
var touches = TUIOManager.Instance.touches; |
|
|
|
var touches = TUIOManager.Instance.touches; |
|
|
|
foreach (var id in touches.Keys) |
|
|
|
foreach (var id in touches.Keys) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
movieController movie = null; |
|
|
|
movieController movie = null; |
|
|
|
if (movies.ContainsKey(id) == false) // Add |
|
|
|
if (movies.ContainsKey(id) == false) // Add |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -56,7 +55,7 @@ public class tuio_event : MonoBehaviour |
|
|
|
movie.fade_speed = img_fade_speed; |
|
|
|
movie.fade_speed = img_fade_speed; |
|
|
|
movie.wait_sec = img_wait_sec; |
|
|
|
movie.wait_sec = img_wait_sec; |
|
|
|
movie.size = new Vector2(snow_size, snow_size); |
|
|
|
movie.size = new Vector2(snow_size, snow_size); |
|
|
|
movie.volume = audio_volume; |
|
|
|
//movie.volume = audio_volume; |
|
|
|
movie.id = id; |
|
|
|
movie.id = id; |
|
|
|
movies.Add(id, movie); |
|
|
|
movies.Add(id, movie); |
|
|
|
var rt = movie.transform as RectTransform; |
|
|
|
var rt = movie.transform as RectTransform; |
|
|
|
@ -73,6 +72,7 @@ public class tuio_event : MonoBehaviour |
|
|
|
var rt = movie.transform as RectTransform; |
|
|
|
var rt = movie.transform as RectTransform; |
|
|
|
//rt.anchoredPosition = touches[id].position; |
|
|
|
//rt.anchoredPosition = touches[id].position; |
|
|
|
float delta_pos = Vector2.Distance(pre_pos[id], rt.anchoredPosition); |
|
|
|
float delta_pos = Vector2.Distance(pre_pos[id], rt.anchoredPosition); |
|
|
|
|
|
|
|
//Debug.Log(delta_pos); |
|
|
|
if (delta_pos > delta_threshold) |
|
|
|
if (delta_pos > delta_threshold) |
|
|
|
{ |
|
|
|
{ |
|
|
|
movie.force_destroy = true; |
|
|
|
movie.force_destroy = true; |
|
|
|
|