switch from Unity version control to git

This commit is contained in:
Leo Qu
2026-01-07 23:54:53 -05:00
commit a098ec74d9
10166 changed files with 1614580 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Runtime.InteropServices;
using System;
using Google.FlatBuffers;
public class ControlLibrary : MonoBehaviour
{
[DllImport("libcontrol")]
public static extern void init();
[DllImport("libcontrol")]
public static extern void cleanup();
[DllImport("libcontrol")]
public static extern int send_angle_control(int module_id, int angle);
[DllImport("libcontrol")]
private static extern IntPtr get_configuration(out int module_id); // the data this points to will be invalidated when called again
public static Frontend.RobotConfiguration getRobotConfiguration() // this is not thread safe
{
int size;
IntPtr ptr = get_configuration(out size);
byte[] buffer = new byte[size];
Marshal.Copy(ptr, buffer, 0, size);
ByteBuffer bb = new ByteBuffer(buffer);
var myObject = Frontend.RobotConfiguration.GetRootAsRobotConfiguration(bb);
return myObject;
}
}