39 lines
846 B
C#
39 lines
846 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using Models;
|
|
using UnityEngine;
|
|
|
|
public class CubeBehaviour : MonoBehaviour
|
|
{
|
|
public Vector3 rotateAmount = new Vector3(0, 1, 0);
|
|
private readonly UdpListener _listener = new UdpListener();
|
|
|
|
// Start is called before the first frame update
|
|
private void Start()
|
|
{
|
|
_listener.AddHandler(LogLandmarks);
|
|
_listener.Connect(5000);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
private void Update()
|
|
{
|
|
transform.Rotate(rotateAmount);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
_listener.DisConnect();
|
|
}
|
|
|
|
private static void LogLandmarks(List<PoseLandmark> landmarks)
|
|
{
|
|
foreach (var landmark in landmarks)
|
|
{
|
|
Debug.Log(landmark.ToString());
|
|
}
|
|
}
|
|
}
|