commonLightPropertyGridComponent.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. import * as React from "react";
  2. import { Light, Observable } from "babylonjs";
  3. import { PropertyChangedEvent } from "../../../../propertyChangedEvent";
  4. import { LineContainerComponent } from "../../../lineContainerComponent";
  5. import { FloatLineComponent } from "../../../lines/floatLineComponent";
  6. import { TextLineComponent } from "../../../lines/textLineComponent";
  7. import { LockObject } from "../lockObject";
  8. interface ICommonLightPropertyGridComponentProps {
  9. light: Light,
  10. lockObject: LockObject,
  11. onPropertyChangedObservable?: Observable<PropertyChangedEvent>
  12. }
  13. export class CommonLightPropertyGridComponent extends React.Component<ICommonLightPropertyGridComponentProps> {
  14. constructor(props: ICommonLightPropertyGridComponentProps) {
  15. super(props);
  16. }
  17. render() {
  18. const light = this.props.light;
  19. return (
  20. <LineContainerComponent title="GENERAL">
  21. <TextLineComponent label="ID" value={light.id} />
  22. <TextLineComponent label="Unique ID" value={light.uniqueId.toString()} />
  23. <TextLineComponent label="Class" value={light.getClassName()} />
  24. <FloatLineComponent lockObject={this.props.lockObject} label="Intensity" target={light} propertyName="intensity" onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
  25. </LineContainerComponent>
  26. );
  27. }
  28. }