|
| 1 | +import { Component, ReactNode } from "react"; |
| 2 | + |
| 3 | +import { AbstractMesh } from "babylonjs"; |
| 4 | +import { LavaMaterial } from "babylonjs-materials"; |
| 5 | + |
| 6 | +import { EditorInspectorColorField } from "../fields/color"; |
| 7 | +import { EditorInspectorStringField } from "../fields/string"; |
| 8 | +import { EditorInspectorSwitchField } from "../fields/switch"; |
| 9 | +import { EditorInspectorNumberField } from "../fields/number"; |
| 10 | +import { EditorInspectorTextureField } from "../fields/texture"; |
| 11 | +import { EditorInspectorSectionField } from "../fields/section"; |
| 12 | + |
| 13 | +import { EditorMaterialInspectorUtilsComponent } from "./components/utils"; |
| 14 | + |
| 15 | +export interface IEditorLavaMaterialInspectorProps { |
| 16 | + mesh?: AbstractMesh; |
| 17 | + material: LavaMaterial; |
| 18 | +} |
| 19 | + |
| 20 | +export class EditorLavaMaterialInspector extends Component<IEditorLavaMaterialInspectorProps> { |
| 21 | + public constructor(props: IEditorLavaMaterialInspectorProps) { |
| 22 | + super(props); |
| 23 | + } |
| 24 | + |
| 25 | + public render(): ReactNode { |
| 26 | + return ( |
| 27 | + <> |
| 28 | + <EditorInspectorSectionField title="Material" label={this.props.material.getClassName()}> |
| 29 | + <EditorInspectorStringField label="Name" object={this.props.material} property="name" /> |
| 30 | + <EditorInspectorSwitchField label="Back Face Culling" object={this.props.material} property="backFaceCulling" /> |
| 31 | + |
| 32 | + <EditorMaterialInspectorUtilsComponent mesh={this.props.mesh} material={this.props.material} /> |
| 33 | + </EditorInspectorSectionField> |
| 34 | + |
| 35 | + <EditorInspectorSectionField title="Lava"> |
| 36 | + <EditorInspectorTextureField hideLevel object={this.props.material} title="Diffuse Texture" property="diffuseTexture" /> |
| 37 | + <EditorInspectorTextureField hideLevel object={this.props.material} title="Noise Texture" property="noiseTexture" /> |
| 38 | + |
| 39 | + <EditorInspectorNumberField object={this.props.material} property="speed" label="Speed" /> |
| 40 | + <EditorInspectorNumberField object={this.props.material} property="movingSpeed" label="Moving Speed" /> |
| 41 | + <EditorInspectorNumberField object={this.props.material} property="lowFrequencySpeed" label="Low Frequency Speed" /> |
| 42 | + </EditorInspectorSectionField> |
| 43 | + |
| 44 | + <EditorInspectorSectionField title="Fog"> |
| 45 | + <EditorInspectorColorField object={this.props.material} property="fogColor" label="Color" /> |
| 46 | + <EditorInspectorNumberField object={this.props.material} property="fogDensity" label="Density" /> |
| 47 | + </EditorInspectorSectionField> |
| 48 | + |
| 49 | + <EditorInspectorSectionField title="Misc"> |
| 50 | + <EditorInspectorSwitchField label="Unlit" object={this.props.material} property="unlit" /> |
| 51 | + <EditorInspectorSwitchField label="Disable Lighting" object={this.props.material} property="disableLighting" /> |
| 52 | + </EditorInspectorSectionField> |
| 53 | + </> |
| 54 | + ); |
| 55 | + } |
| 56 | +} |
0 commit comments