Skip to content

Commit 7cdcecf

Browse files
committed
Add action to change the max
1 parent 7ba0483 commit 7cdcecf

1 file changed

Lines changed: 107 additions & 4 deletions

File tree

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

Lines changed: 107 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7554,6 +7554,17 @@
75547554
"3",
75557555
""
75567556
]
7557+
},
7558+
{
7559+
"type": {
7560+
"value": "Light3D::SetLightShadowCountMax"
7561+
},
7562+
"parameters": [
7563+
"",
7564+
"=",
7565+
"1",
7566+
""
7567+
]
75577568
}
75587569
]
75597570
}
@@ -42509,6 +42520,14 @@
4250942520
" value: 20",
4251042521
"};",
4251142522
"",
42523+
"const editorLightShadowCountMax = {",
42524+
" value: 1",
42525+
"};",
42526+
"",
42527+
"const lightShadowCountMax = {",
42528+
" value: 4",
42529+
"};",
42530+
"",
4251242531
"/**",
4251342532
" * Get the platforms manager of an instance container.",
4251442533
" * @param {gdjs.RuntimeScene & {__lightManager: LightManager}} runtimeScene",
@@ -42517,8 +42536,8 @@
4251742536
" if (!runtimeScene.__lightManager) {",
4251842537
" // Create the shared manager if necessary.",
4251942538
" runtimeScene.__lightManager = isInGameEdition ?",
42520-
" new LightManager(editorLightCountMax, 1) :",
42521-
" new LightManager(lightCountMax, 4);",
42539+
" new LightManager(editorLightCountMax, editorLightShadowCountMax) :",
42540+
" new LightManager(lightCountMax, lightShadowCountMax);",
4252242541
" }",
4252342542
" return runtimeScene.__lightManager;",
4252442543
"}",
@@ -42605,7 +42624,7 @@
4260542624
"",
4260642625
" /**",
4260742626
" * @param maxCount {{value: number}}",
42608-
" * @param shadowCount {number}",
42627+
" * @param shadowCount {{value: number}}",
4260942628
" */",
4261042629
" constructor(maxCount, shadowCount) {",
4261142630
" this.visibleObjects = new CappedLightList(",
@@ -42614,7 +42633,7 @@
4261442633
" (object) => { object.__light3D.visible = false; }",
4261542634
" );",
4261642635
" this.shadowObjects = new CappedLightList(",
42617-
" { value: shadowCount },",
42636+
" shadowCount,",
4261842637
" (object) => { object.__light3D.castShadow = true; },",
4261942638
" (object) => { object.__light3D.castShadow = false; }",
4262042639
" );",
@@ -42643,6 +42662,7 @@
4264342662
"gdjs.__light3DExtension = {",
4264442663
" Light3DRenderer,",
4264542664
" lightCountMax,",
42665+
" lightShadowCountMax,",
4264642666
"}"
4264742667
],
4264842668
"parameterObjects": "",
@@ -42729,6 +42749,83 @@
4272942749
],
4273042750
"parameters": [],
4273142751
"objectGroups": []
42752+
},
42753+
{
42754+
"description": "the maximum number of nearest lights displayed with shadow simultaneously.",
42755+
"fullName": "Max lights with shadow count",
42756+
"functionType": "ExpressionAndCondition",
42757+
"name": "LightShadowCountMax",
42758+
"sentence": "max lights with shadow count",
42759+
"events": [
42760+
{
42761+
"type": "BuiltinCommonInstructions::Standard",
42762+
"conditions": [],
42763+
"actions": [
42764+
{
42765+
"type": {
42766+
"value": "Light3D::DefineHelperClasses"
42767+
},
42768+
"parameters": [
42769+
"",
42770+
""
42771+
]
42772+
}
42773+
]
42774+
},
42775+
{
42776+
"type": "BuiltinCommonInstructions::JsCode",
42777+
"inlineCode": [
42778+
"",
42779+
"eventsFunctionContext.returnValue = gdjs.__light3DExtension.lightShadowCountMax.value;"
42780+
],
42781+
"parameterObjects": "",
42782+
"useStrict": true,
42783+
"eventsSheetExpanded": false
42784+
}
42785+
],
42786+
"expressionType": {
42787+
"type": "expression"
42788+
},
42789+
"parameters": [],
42790+
"objectGroups": []
42791+
},
42792+
{
42793+
"fullName": "",
42794+
"functionType": "ActionWithOperator",
42795+
"getterName": "LightShadowCountMax",
42796+
"name": "SetLightShadowCountMax",
42797+
"sentence": "",
42798+
"events": [
42799+
{
42800+
"type": "BuiltinCommonInstructions::Standard",
42801+
"conditions": [],
42802+
"actions": [
42803+
{
42804+
"type": {
42805+
"value": "Light3D::DefineHelperClasses"
42806+
},
42807+
"parameters": [
42808+
"",
42809+
""
42810+
]
42811+
}
42812+
]
42813+
},
42814+
{
42815+
"type": "BuiltinCommonInstructions::JsCode",
42816+
"inlineCode": [
42817+
"",
42818+
"const value = eventsFunctionContext.getArgument(\"Value\");",
42819+
"",
42820+
"gdjs.__light3DExtension.lightShadowCountMax.value = value;"
42821+
],
42822+
"parameterObjects": "",
42823+
"useStrict": true,
42824+
"eventsSheetExpanded": false
42825+
}
42826+
],
42827+
"parameters": [],
42828+
"objectGroups": []
4273242829
}
4273342830
],
4273442831
"eventsFunctionsFolderStructure": {
@@ -42748,6 +42845,12 @@
4274842845
},
4274942846
{
4275042847
"functionName": "SetLightCountMax"
42848+
},
42849+
{
42850+
"functionName": "LightShadowCountMax"
42851+
},
42852+
{
42853+
"functionName": "SetLightShadowCountMax"
4275142854
}
4275242855
]
4275342856
},

0 commit comments

Comments
 (0)