Skip to content

Commit d334433

Browse files
committed
Use an expression to get game orientation in 3D car coin hunt Screen Orientation Checker object
Don't show in changelog
1 parent 16c2315 commit d334433

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

examples/3d-car-coin-hunt/3d-car-coin-hunt.json

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,23 +4426,49 @@
44264426
"sceneVariables": [],
44274427
"eventsFunctions": [
44284428
{
4429-
"fullName": "",
4430-
"functionType": "Action",
4431-
"name": "onFirstSceneLoaded",
4429+
"fullName": "Get game target orientation",
4430+
"functionType": "StringExpression",
4431+
"name": "ProjectOrientation",
4432+
"private": true,
44324433
"sentence": "",
44334434
"events": [
44344435
{
44354436
"type": "BuiltinCommonInstructions::JsCode",
4436-
"inlineCode": [
4437-
"const orientation = runtimeScene.getGame().getGameData().properties.orientation;",
4438-
"",
4439-
"eventsFunctionContext.globalVariablesForExtension.get(\"TargetOrientation\").setString(orientation);"
4440-
],
4437+
"inlineCode": "eventsFunctionContext.returnValue = runtimeScene.getGame().getGameData().properties.orientation;",
44414438
"parameterObjects": "",
44424439
"useStrict": true,
44434440
"eventsSheetExpanded": false
44444441
}
44454442
],
4443+
"expressionType": {
4444+
"type": "string"
4445+
},
4446+
"parameters": [],
4447+
"objectGroups": []
4448+
},
4449+
{
4450+
"fullName": "",
4451+
"functionType": "Action",
4452+
"name": "onFirstSceneLoaded",
4453+
"sentence": "",
4454+
"events": [
4455+
{
4456+
"type": "BuiltinCommonInstructions::Standard",
4457+
"conditions": [],
4458+
"actions": [
4459+
{
4460+
"type": {
4461+
"value": "SetStringVariable"
4462+
},
4463+
"parameters": [
4464+
"TargetOrientation",
4465+
"=",
4466+
"ScreenOrientationChecker::ProjectOrientation()"
4467+
]
4468+
}
4469+
]
4470+
}
4471+
],
44464472
"parameters": [],
44474473
"objectGroups": []
44484474
}

0 commit comments

Comments
 (0)