Skip to content

Commit

Permalink
feat(engine): update wonder.js version
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc-git committed Apr 28, 2019
1 parent 27e5858 commit f7e1eab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"wonder-commonlib": "^0.2.32",
"wonder-hotkey": "^0.0.1",
"wonder-log": "^0.2.11",
"wonder.js": "1.1.0-alpha.1.8"
"wonder.js": "1.1.0-alpha.1.9"
},
"resolutions": {
"wonder-log": "^0.2.11",
Expand Down
4 changes: 3 additions & 1 deletion src/core/job/init/InitScriptAPIJob.re
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ let initJob =
...engineState,
apiRecord: {
...apiRecord,
scriptAPIJsObj: _createScriptAPIJsObj(apiRecord.scriptAPIJsObj),
scriptAPIJsObj:
_createScriptAPIJsObj(apiRecord.scriptAPIJsObj |> Obj.magic)
|> Obj.magic,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ let _ =
let _buildUpdateEventFunctionSetLocalPosition1 = () =>
Some(
(. script, api, engineState: Wonderjs.StateDataMainType.state) => {
let api = Obj.magic(api);
let unsafeGetGameObjectTransformComponent =
api##unsafeGetGameObjectTransformComponent;
let setTransformLocalPosition = api##setTransformLocalPosition;
Expand All @@ -166,6 +167,7 @@ let _ =
let _buildUpdateEventFunctionSetLocalPosition2 = () =>
Some(
(. script, api, engineState: Wonderjs.StateDataMainType.state) => {
let api = Obj.magic(api);
let unsafeGetGameObjectTransformComponent =
api##unsafeGetGameObjectTransformComponent;
let setTransformLocalPosition = api##setTransformLocalPosition;
Expand Down Expand Up @@ -238,7 +240,7 @@ let _ =
~currentScriptEventFunctionNodeId=Some(addedNodeId1),
~targetScriptEventFunctionNodeId=addedNodeId2,
~send=SinonTool.createOneLengthStub(sandbox^),
()
(),
);

let gameObject1 =
Expand Down Expand Up @@ -370,6 +372,7 @@ let _ =
api,
engineState: Wonderjs.StateDataMainType.state,
) => {
let api = Obj.magic(api);
let disposeGameObject = api##disposeGameObject;
let findGameObjectsByName = api##findGameObjectsByName;

Expand Down Expand Up @@ -402,6 +405,7 @@ let _ =
api,
engineState: Wonderjs.StateDataMainType.state,
) => {
let api = Obj.magic(api);
let unsafeGetGameObjectTransformComponent =
api##unsafeGetGameObjectTransformComponent;
let setTransformLocalPosition =
Expand Down Expand Up @@ -558,6 +562,7 @@ let _ =
api,
engineState: Wonderjs.StateDataMainType.state,
) => {
let api = Obj.magic(api);
let disposeGameObject = api##disposeGameObject;
let findGameObjectsByName = api##findGameObjectsByName;

Expand Down Expand Up @@ -777,6 +782,7 @@ let _ =
api,
engineState: Wonderjs.StateDataMainType.state,
) => {
let api = Obj.magic(api);
let unsafeGetGameObjectTransformComponent =
api##unsafeGetGameObjectTransformComponent;
let setTransformLocalPosition =
Expand Down
1 change: 1 addition & 0 deletions test/tool/engine/ScriptToolEngine.re
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ let buildScriptEventFunctionData = (~initFunc, ~updateFunc, ~disposeFunc) =>

let buildSetLocalPositionEventFunc = () =>
(. script, api, engineState) => {
let api = Obj.magic(api);
let unsafeGetScriptGameObject = api##unsafeGetScriptGameObject;
let unsafeGetGameObjectTransformComponent =
api##unsafeGetGameObjectTransformComponent;
Expand Down

0 comments on commit f7e1eab

Please sign in to comment.