add TuioDrawer for tuio calibration test

master
uc deploy 8 years ago
parent 459a835016
commit 8c8121519a
  1. 1050
      Unity_2018_Frozen/Assets/Frozen/Frozen.unity
  2. 41
      Unity_2018_Frozen/Assets/Frozen/Script/TuioDrawer.cs
  3. 13
      Unity_2018_Frozen/Assets/Frozen/Script/TuioDrawer.cs.meta

File diff suppressed because it is too large Load Diff

@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TuioDrawer : MonoBehaviour
{
List<Button> buttons;
void Start()
{
//var btn = GetComponentInChildren<Button>();
//btn.gameObject.SetActive(false);
buttons = new List<Button>();
//buttons.Add(btn);
buttons.AddRange(GetComponentsInChildren<Button>());
}
void Update()
{
foreach (var btn in buttons)
{
btn.gameObject.SetActive(false);
}
var touches = TUIOManager.Instance.touches;
int i = 0;
foreach (var t in touches.Values)
{
if (i < buttons.Count)
{
buttons[i].gameObject.SetActive(true);
var rt = buttons[i].transform as RectTransform;
rt.anchoredPosition = t.position;//.Scale(new Vector2(1280, 800));
i++;
}
}
}
}

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e14988301cb7dbb4d8025f9576b3d588
timeCreated: 1529738981
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save