Skip to content

Commit

Permalink
Merge pull request #13141 from BlakeOne/master
Browse files Browse the repository at this point in the history
Add Vector2 type to custom inspector properties

Former-commit-id: 798a5157943f9d4809405369f9ef0b0f8983b75d
  • Loading branch information
sebavan authored Oct 20, 2022
2 parents 4466588 + 2f72f9e commit a02fba1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/dev/core/src/Misc/iInspectable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export enum InspectableType {
* File button
*/
FileButton = 9,
/**
* Vector2
*/
Vector2 = 10,
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { IInspectable } from "core/Misc/iInspectable";
import { InspectableType } from "core/Misc/iInspectable";
import { CheckBoxLineComponent } from "shared-ui-components/lines/checkBoxLineComponent";
import { SliderLineComponent } from "shared-ui-components/lines/sliderLineComponent";
import { Vector2LineComponent } from "shared-ui-components/lines/vector2LineComponent";
import { Vector3LineComponent } from "shared-ui-components/lines/vector3LineComponent";
import { QuaternionLineComponent } from "../../lines/quaternionLineComponent";
import { LineContainerComponent } from "shared-ui-components/lines/lineContainerComponent";
Expand Down Expand Up @@ -57,6 +58,17 @@ export class CustomPropertyGridComponent extends React.Component<ICustomProperty
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
/>
);
case InspectableType.Vector2:
return (
<Vector2LineComponent
lockObject={this.props.lockObject}
key={inspectable.label}
label={inspectable.label}
target={this.props.target}
propertyName={inspectable.propertyName}
onPropertyChangedObservable={this.props.onPropertyChangedObservable}
/>
);
case InspectableType.Vector3:
return (
<Vector3LineComponent
Expand Down

0 comments on commit a02fba1

Please sign in to comment.