UI material + environment change

Made-with: Cursor
This commit is contained in:
Leo Qu
2026-03-03 15:03:54 -05:00
parent 20480f6eaf
commit 00f8359961
28 changed files with 7757 additions and 5533 deletions

View File

@@ -8,14 +8,15 @@ public abstract class ModuleBase : MonoBehaviour
public void SendToControlLibrary(string moduleType, float currentAngle)
{
int angleRounded = Mathf.RoundToInt(currentAngle);
var json = "";
if (moduleType.Contains("Servo"))
if (moduleType.Contains("Servo") || moduleType == "Gripper")
{
json = JsonUtility.ToJson(new ServoCommand
{
ModuleId = moduleID,
Type = moduleType,
TargetAngle = currentAngle
TargetAngle = angleRounded
});
}
else if(moduleType == "DC")
@@ -29,7 +30,7 @@ public abstract class ModuleBase : MonoBehaviour
{
ModuleId = moduleID,
Type = moduleType,
RotateByDegrees = Math.Abs(currentAngle),
RotateByDegrees = Math.Abs(angleRounded),
Direction = direction
});
}
@@ -38,7 +39,7 @@ public abstract class ModuleBase : MonoBehaviour
{
return;
}
if (0 != ControlLibrary.send_angle_control(Int32.Parse(moduleID), (int)currentAngle))
if (0 != ControlLibrary.send_angle_control(Int32.Parse(moduleID), angleRounded))
{
Debug.Log("Control library exited with error");
}