diff --git a/assets/graph/simpleController.json b/assets/graph/simpleController.json index e1ac4e0..be8f723 100644 --- a/assets/graph/simpleController.json +++ b/assets/graph/simpleController.json @@ -25,7 +25,7 @@ "value": "speed" }, "value": { - "value": "2" + "value": ".8" } } }, diff --git a/examples/behaveGraph.tsx b/examples/behaveGraph.tsx index ec3627c..5290d88 100644 --- a/examples/behaveGraph.tsx +++ b/examples/behaveGraph.tsx @@ -1,14 +1,11 @@ import React from 'react' import { GraphJSON } from '@behave-graph/core' -import { Flow } from '@etherealengine/editor/src/components/graph/ee-flow' +import { ActiveBehaveGraph } from '@etherealengine/editor/src/components/graph/BehaveFlow' import '@etherealengine/editor/src/components/graph/ee-flow/styles.css' import { BehaveGraphComponent } from '@etherealengine/engine/src/behave-graph/components/BehaveGraphComponent' -import { BehaveGraphState } from '@etherealengine/engine/src/behave-graph/state/BehaveGraphState' -import { setComponent, useComponent } from '@etherealengine/engine/src/ecs/functions/ComponentFunctions' +import { setComponent } from '@etherealengine/engine/src/ecs/functions/ComponentFunctions' import { createEntity } from '@etherealengine/engine/src/ecs/functions/EntityFunctions' -import { NO_PROXY, getMutableState, useHookstate } from '@etherealengine/hyperflux' -import isEqual from 'lodash/isEqual' import AutoSizer from 'react-virtualized-auto-sizer' import 'reactflow/dist/style.css' import targetJson from '../assets/graph/simpleController.json' @@ -18,8 +15,6 @@ const entity = createEntity() setComponent(entity, BehaveGraphComponent, { graph: targetJson as unknown as GraphJSON }) export default function behaveGraphTest() { - const graphComponent = useComponent(entity, BehaveGraphComponent) - const behavegraphState = useHookstate(getMutableState(BehaveGraphState)) return ( <> @@ -37,15 +32,7 @@ export default function behaveGraphTest() { {({ width, height }) => (
- { - if (!graphComponent.graph || isEqual(graphComponent.graph.get(NO_PROXY), newGraph)) return - graphComponent.graph.set(JSON.parse(JSON.stringify(newGraph))) - }} - /> +
)}