def _setup_effect(self):
        """
        Use tag to apply color to different objects (instances)
        Returns: None
        """
        # setup camera

        if get_engine() is None:
            super()._setup_effect()
        else:
            mapping = get_engine().id_c
            spawned_objects = get_engine().get_objects()

            ##Ensure consistency between color mapping and the objects actually active in the engine.
            mapping_set, object_set = set(list(mapping.keys())), set(list(spawned_objects.keys()))
            assert (len(mapping_set.difference(object_set)) == 0)

            for id, obj in spawned_objects.items():
                obj.origin.setTag(CameraTagStateKey.ID, id)
            cam = self.get_cam().node()
            cam.setTagStateKey(CameraTagStateKey.ID)
            cam.setInitialState(
                RenderState.make(
                    ShaderAttrib.makeOff(), LightAttrib.makeAllOff(), TextureAttrib.makeOff(),
                    ColorAttrib.makeFlat((0, 0, 0, 1)), 1
                )
            )

            for id in spawned_objects.keys():
                c = mapping[id]
                assert c in self.engine.COLORS_OCCUPIED
                cam.setTagState(id, RenderState.make(ColorAttrib.makeFlat((c[0], c[1], c[2], 1)), 1))

        Use tag to apply color to different objects (instances)
        Returns: None
        
metadrive/component/sensors/instance_camera.py