|
628 | 628 | " value: 20", |
629 | 629 | "};", |
630 | 630 | "", |
| 631 | + "const editorLightShadowCountMax = {", |
| 632 | + " value: 1", |
| 633 | + "};", |
| 634 | + "", |
| 635 | + "const lightShadowCountMax = {", |
| 636 | + " value: 4", |
| 637 | + "};", |
| 638 | + "", |
631 | 639 | "/**", |
632 | 640 | " * Get the platforms manager of an instance container.", |
633 | 641 | " * @param {gdjs.RuntimeScene & {__lightManager: LightManager}} runtimeScene", |
|
636 | 644 | " if (!runtimeScene.__lightManager) {", |
637 | 645 | " // Create the shared manager if necessary.", |
638 | 646 | " runtimeScene.__lightManager = isInGameEdition ?", |
639 | | - " new LightManager(editorLightCountMax, 1) :", |
640 | | - " new LightManager(lightCountMax, 4);", |
| 647 | + " new LightManager(editorLightCountMax, editorLightShadowCountMax) :", |
| 648 | + " new LightManager(lightCountMax, lightShadowCountMax);", |
641 | 649 | " }", |
642 | 650 | " return runtimeScene.__lightManager;", |
643 | 651 | "}", |
|
724 | 732 | "", |
725 | 733 | " /**", |
726 | 734 | " * @param maxCount {{value: number}}", |
727 | | - " * @param shadowCount {number}", |
| 735 | + " * @param shadowCount {{value: number}}", |
728 | 736 | " */", |
729 | 737 | " constructor(maxCount, shadowCount) {", |
730 | 738 | " this.visibleObjects = new CappedLightList(", |
|
733 | 741 | " (object) => { object.__light3D.visible = false; }", |
734 | 742 | " );", |
735 | 743 | " this.shadowObjects = new CappedLightList(", |
736 | | - " { value: shadowCount },", |
| 744 | + " shadowCount,", |
737 | 745 | " (object) => { object.__light3D.castShadow = true; },", |
738 | 746 | " (object) => { object.__light3D.castShadow = false; }", |
739 | 747 | " );", |
|
762 | 770 | "gdjs.__light3DExtension = {", |
763 | 771 | " Light3DRenderer,", |
764 | 772 | " lightCountMax,", |
| 773 | + " lightShadowCountMax,", |
765 | 774 | "}" |
766 | 775 | ], |
767 | 776 | "parameterObjects": "", |
|
848 | 857 | ], |
849 | 858 | "parameters": [], |
850 | 859 | "objectGroups": [] |
| 860 | + }, |
| 861 | + { |
| 862 | + "description": "the maximum number of nearest lights displayed with shadow simultaneously.", |
| 863 | + "fullName": "Max lights with shadow count", |
| 864 | + "functionType": "ExpressionAndCondition", |
| 865 | + "name": "LightShadowCountMax", |
| 866 | + "sentence": "max lights with shadow count", |
| 867 | + "events": [ |
| 868 | + { |
| 869 | + "type": "BuiltinCommonInstructions::Standard", |
| 870 | + "conditions": [], |
| 871 | + "actions": [ |
| 872 | + { |
| 873 | + "type": { |
| 874 | + "value": "Light3D::DefineHelperClasses" |
| 875 | + }, |
| 876 | + "parameters": [ |
| 877 | + "", |
| 878 | + "" |
| 879 | + ] |
| 880 | + } |
| 881 | + ] |
| 882 | + }, |
| 883 | + { |
| 884 | + "type": "BuiltinCommonInstructions::JsCode", |
| 885 | + "inlineCode": [ |
| 886 | + "", |
| 887 | + "eventsFunctionContext.returnValue = gdjs.__light3DExtension.lightShadowCountMax.value;" |
| 888 | + ], |
| 889 | + "parameterObjects": "", |
| 890 | + "useStrict": true, |
| 891 | + "eventsSheetExpanded": false |
| 892 | + } |
| 893 | + ], |
| 894 | + "expressionType": { |
| 895 | + "type": "expression" |
| 896 | + }, |
| 897 | + "parameters": [], |
| 898 | + "objectGroups": [] |
| 899 | + }, |
| 900 | + { |
| 901 | + "fullName": "", |
| 902 | + "functionType": "ActionWithOperator", |
| 903 | + "getterName": "LightShadowCountMax", |
| 904 | + "name": "SetLightShadowCountMax", |
| 905 | + "sentence": "", |
| 906 | + "events": [ |
| 907 | + { |
| 908 | + "type": "BuiltinCommonInstructions::Standard", |
| 909 | + "conditions": [], |
| 910 | + "actions": [ |
| 911 | + { |
| 912 | + "type": { |
| 913 | + "value": "Light3D::DefineHelperClasses" |
| 914 | + }, |
| 915 | + "parameters": [ |
| 916 | + "", |
| 917 | + "" |
| 918 | + ] |
| 919 | + } |
| 920 | + ] |
| 921 | + }, |
| 922 | + { |
| 923 | + "type": "BuiltinCommonInstructions::JsCode", |
| 924 | + "inlineCode": [ |
| 925 | + "", |
| 926 | + "const value = eventsFunctionContext.getArgument(\"Value\");", |
| 927 | + "", |
| 928 | + "gdjs.__light3DExtension.lightShadowCountMax.value = value;" |
| 929 | + ], |
| 930 | + "parameterObjects": "", |
| 931 | + "useStrict": true, |
| 932 | + "eventsSheetExpanded": false |
| 933 | + } |
| 934 | + ], |
| 935 | + "parameters": [], |
| 936 | + "objectGroups": [] |
851 | 937 | } |
852 | 938 | ], |
853 | 939 | "eventsFunctionsFolderStructure": { |
|
867 | 953 | }, |
868 | 954 | { |
869 | 955 | "functionName": "SetLightCountMax" |
| 956 | + }, |
| 957 | + { |
| 958 | + "functionName": "LightShadowCountMax" |
| 959 | + }, |
| 960 | + { |
| 961 | + "functionName": "SetLightShadowCountMax" |
870 | 962 | } |
871 | 963 | ] |
872 | 964 | }, |
|
0 commit comments