floatPropertyTabComponent.tsx 968 B

123456789101112131415161718192021222324
  1. import * as React from "react";
  2. import { GlobalState } from '../../../globalState';
  3. import { FloatLineComponent } from '../../../sharedComponents/floatLineComponent';
  4. import { InputBlock } from 'babylonjs/Materials/Node/Blocks/Input/inputBlock';
  5. interface IFloatPropertyTabComponentProps {
  6. globalState: GlobalState;
  7. inputBlock: InputBlock;
  8. }
  9. export class FloatPropertyTabComponent extends React.Component<IFloatPropertyTabComponentProps> {
  10. render() {
  11. return (
  12. <FloatLineComponent globalState={this.props.globalState} label="Value" target={this.props.inputBlock} propertyName="value" onChange={() => {
  13. if (this.props.inputBlock.isConstant) {
  14. this.props.globalState.onRebuildRequiredObservable.notifyObservers();
  15. }
  16. this.props.globalState.onUpdateRequiredObservable.notifyObservers();
  17. }}></FloatLineComponent>
  18. );
  19. }
  20. }