Beispiel #1
0
        private void Start()
        {
            this.pointCloud = new Vector3[0];
            subscriber      = this.GetComponent <SubscribePointCloud2>();
            subscriber.AddListenerToNewPointCloud(NewPointCloud);

            materialPropertyBlock = new MaterialPropertyBlock();

            CreateCubeMesh();
        }
        static public GameObject PointCloud2(string name, string defaultTopic, bool canTransform)
        {
            GameObject           pc2GameObject = new GameObject(name);
            SubscribePointCloud2 subscribe     = pc2GameObject.AddComponent <SubscribePointCloud2>();
            VisualizePointCloud2 visualize     = pc2GameObject.AddComponent <VisualizePointCloud2>();

            subscribe.Topic = defaultTopic;

            MyExposeToEditor myExposeToEditor = pc2GameObject.AddComponent <MyExposeToEditor>();

            myExposeToEditor.CanTransform  = canTransform;
            myExposeToEditor.ShowTransform = canTransform;

            pc2GameObject.tag = "RosData";

            return(pc2GameObject);
        }
        static public GameObject PointCloud2(string name, string defaultTopic, bool canTransform, bool startSubscribe, Color color)
        {
            GameObject           pc2GameObject = new GameObject(name);//Create gameObj that name is 'name'
            SubscribePointCloud2 subscribe     = pc2GameObject.AddComponent <SubscribePointCloud2>();
            VisualizePointCloud2 visualize     = pc2GameObject.AddComponent <VisualizePointCloud2>();

            subscribe.Topic   = defaultTopic;
            subscribe.Enabled = startSubscribe;

            visualize.PointColor = color;

            MyExposeToEditor myExposeToEditor = pc2GameObject.AddComponent <MyExposeToEditor>();

            myExposeToEditor.CanTransform  = canTransform;
            myExposeToEditor.ShowTransform = canTransform;

            pc2GameObject.tag = "RosData";

            return(pc2GameObject);
        }