selected object is highlighted only in editor
This commit is contained in:
parent
ca5dea5093
commit
f3033d1d0d
|
|
@ -16,7 +16,8 @@ export const ObjectView = observer(function ({ object }: ObjectViewProps) {
|
||||||
if (!objectType)
|
if (!objectType)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
const isSelected = state.worldEditor.selectedObjectId === object.id;
|
const isSelected = state.worldEditor.isEnabled &&
|
||||||
|
state.worldEditor.selectedObjectId === object.id;
|
||||||
|
|
||||||
const handleClick = (e: { stopPropagation: () => void }) => {
|
const handleClick = (e: { stopPropagation: () => void }) => {
|
||||||
if (!state.worldEditor.isEnabled)
|
if (!state.worldEditor.isEnabled)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { CharacterState } from "./character";
|
||||||
import type { Pos3, V3 } from "../types/3d";
|
import type { Pos3, V3 } from "../types/3d";
|
||||||
import { clone, randomId } from "../utils";
|
import { clone, randomId } from "../utils";
|
||||||
import type { VoxelType } from "../types/voxel";
|
import type { VoxelType } from "../types/voxel";
|
||||||
|
import { state } from "./root";
|
||||||
|
|
||||||
export class WorldState {
|
export class WorldState {
|
||||||
public data: World = WorldFactory.create();
|
public data: World = WorldFactory.create();
|
||||||
|
|
@ -117,6 +118,8 @@ export class WorldState {
|
||||||
scene: clone(this.data.intialScene),
|
scene: clone(this.data.intialScene),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.worldEditor.setSelectedObjectId(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
public pause(): void {
|
public pause(): void {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue