Skip to content

Commit

Permalink
fix: fix "clone gameObject" and "drag wdb" bug refer to #ab2bd6
Browse files Browse the repository at this point in the history
solution
StateEditorService.setState(editorState) refreshEngineStateAndReturnEngineState.
  • Loading branch information
yyc-git committed Feb 15, 2019
1 parent ab2bd61 commit 37fceb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module CustomEventHandler = {
let editorState = StateEditorService.getState();
let engineState = StateEngineService.unsafeGetState();

let (editorState, engineState) =
let engineState =
LeftHeaderGameObjectResultUtils.getTargetGameObject()
|> Result.Result.either(
targetGameObject => {
Expand Down Expand Up @@ -65,21 +65,23 @@ module CustomEventHandler = {
|> SceneEngineService.clearShaderCacheAndReInitSceneAllLightMaterials :
engineState;

editorState |> StateEditorService.setState |> ignore;

let engineState =
StateLogicService.refreshEngineStateAndReturnEngineState(
engineState,
);

(editorState, engineState);
engineState;
},
errorMsg => {
ConsoleUtils.error(errorMsg, editorState);

(editorState, engineState);
engineState;
},
);

StateLogicService.setState((editorState, engineState));
engineState |> StateEngineService.setState |> ignore;

dispatchFunc(AppStore.UpdateAction(Update([|Inspector, SceneTree|])))
|> ignore;
Expand Down
4 changes: 3 additions & 1 deletion src/core/utils/DragWDBUtils.re
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ let dragWDB =
engineState,
);

editorState |> StateEditorService.setState |> ignore;

let engineState =
StateLogicService.refreshEngineStateAndReturnEngineState(engineState);

(true, (editorState, engineState));
(true, (StateEditorService.getState(), engineState));
};

0 comments on commit 37fceb9

Please sign in to comment.