public QueryRenderer(string label, uint nest) : base(label) { constraintField = new global::Improbable.ComponentInterestRenderer.QueryConstraintRenderer("Constraint", nest + 1); Container.Add(constraintField); var fullSnapshotResultInnerField = new Toggle("Value"); fullSnapshotResultInnerField.labelElement.ShiftRightMargin(nest + 1); fullSnapshotResultInnerField.SetEnabled(false); fullSnapshotResultField = new NullableVisualElement <Toggle, bool>("Full Snapshot Result", fullSnapshotResultInnerField, (element, data) => { element.value = data; }); Container.Add(fullSnapshotResultField); resultComponentIdField = new PaginatedListView <TextField, uint>("Result Component Id", () => { var inner = new TextField(""); inner.labelElement.ShiftRightMargin(nest + 1); inner.SetEnabled(false); return(inner); }, (index, data, element) => { element.label = $"Item {index + 1}"; element.value = data.ToString(); }); Container.Add(resultComponentIdField); var frequencyInnerField = new TextField("Value"); frequencyInnerField.labelElement.ShiftRightMargin(nest + 1); frequencyInnerField.SetEnabled(false); frequencyField = new NullableVisualElement <TextField, float>("Frequency", frequencyInnerField, (element, data) => { element.value = data.ToString(); }); Container.Add(frequencyField); }
public QueryConstraintRenderer(string label, uint nest) : base(label) { var sphereConstraintInnerField = new global::Improbable.ComponentInterestRenderer.SphereConstraintRenderer("Value", nest + 1 + 1); sphereConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.SphereConstraintRenderer, global::Improbable.ComponentInterest.SphereConstraint>("Sphere Constraint", sphereConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(sphereConstraintField); var cylinderConstraintInnerField = new global::Improbable.ComponentInterestRenderer.CylinderConstraintRenderer("Value", nest + 1 + 1); cylinderConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.CylinderConstraintRenderer, global::Improbable.ComponentInterest.CylinderConstraint>("Cylinder Constraint", cylinderConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(cylinderConstraintField); var boxConstraintInnerField = new global::Improbable.ComponentInterestRenderer.BoxConstraintRenderer("Value", nest + 1 + 1); boxConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.BoxConstraintRenderer, global::Improbable.ComponentInterest.BoxConstraint>("Box Constraint", boxConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(boxConstraintField); var relativeSphereConstraintInnerField = new global::Improbable.ComponentInterestRenderer.RelativeSphereConstraintRenderer("Value", nest + 1 + 1); relativeSphereConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.RelativeSphereConstraintRenderer, global::Improbable.ComponentInterest.RelativeSphereConstraint>("Relative Sphere Constraint", relativeSphereConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(relativeSphereConstraintField); var relativeCylinderConstraintInnerField = new global::Improbable.ComponentInterestRenderer.RelativeCylinderConstraintRenderer("Value", nest + 1 + 1); relativeCylinderConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.RelativeCylinderConstraintRenderer, global::Improbable.ComponentInterest.RelativeCylinderConstraint>("Relative Cylinder Constraint", relativeCylinderConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(relativeCylinderConstraintField); var relativeBoxConstraintInnerField = new global::Improbable.ComponentInterestRenderer.RelativeBoxConstraintRenderer("Value", nest + 1 + 1); relativeBoxConstraintField = new NullableVisualElement <global::Improbable.ComponentInterestRenderer.RelativeBoxConstraintRenderer, global::Improbable.ComponentInterest.RelativeBoxConstraint>("Relative Box Constraint", relativeBoxConstraintInnerField, (element, data) => { element.Update(data); }); Container.Add(relativeBoxConstraintField); var entityIdConstraintInnerField = new TextField("Value"); entityIdConstraintInnerField.labelElement.ShiftRightMargin(nest + 1); entityIdConstraintInnerField.SetEnabled(false); entityIdConstraintField = new NullableVisualElement <TextField, long>("Entity Id Constraint", entityIdConstraintInnerField, (element, data) => { element.value = data.ToString(); }); Container.Add(entityIdConstraintField); var componentConstraintInnerField = new TextField("Value"); componentConstraintInnerField.labelElement.ShiftRightMargin(nest + 1); componentConstraintInnerField.SetEnabled(false); componentConstraintField = new NullableVisualElement <TextField, uint>("Component Constraint", componentConstraintInnerField, (element, data) => { element.value = data.ToString(); }); Container.Add(componentConstraintField); andConstraintField = new PaginatedListView <global::Improbable.ComponentInterestRenderer.QueryConstraintRenderer, global::Improbable.ComponentInterest.QueryConstraint>("And Constraint", () => { var inner = new global::Improbable.ComponentInterestRenderer.QueryConstraintRenderer("", nest + 1 + 1); return(inner); }, (index, data, element) => { element.Label = $"Item {index + 1}"; element.Update(data); }); Container.Add(andConstraintField); orConstraintField = new PaginatedListView <global::Improbable.ComponentInterestRenderer.QueryConstraintRenderer, global::Improbable.ComponentInterest.QueryConstraint>("Or Constraint", () => { var inner = new global::Improbable.ComponentInterestRenderer.QueryConstraintRenderer("", nest + 1 + 1); return(inner); }, (index, data, element) => { element.Label = $"Item {index + 1}"; element.Update(data); }); Container.Add(orConstraintField); }