using UnityEngine; using RosColor = RosMessageTypes.RoboticsDemo.UnityColor; public class RosSubscriberExample : MonoBehaviour { public ROSConnection ros; public GameObject cube; void Start() { ros.Subscribe("color", ColorChange); } void ColorChange(RosColor colorMessage) { cube.GetComponent().material.color = new Color32((byte)colorMessage.r, (byte)colorMessage.g, (byte)colorMessage.b, (byte)colorMessage.a); } }