Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace arguments shown in the JavaScript code blocks by "instanceContainer" #7058

Open
4ian opened this issue Oct 15, 2024 · 0 comments
Open

Comments

@4ian
Copy link
Owner

4ian commented Oct 15, 2024

A JavaScript code block has by default "runtimeScene" as the first argument, then an optional "objects", then eventsFunctionContext.
In practice, this "runtimeScene" is NOT the runtime scene for objects and behaviors. Instead, it's the instance container.

We should probably not encourage using runtimeScene inside a function of a behavior and object. Instead, we could:

  • keep runtimeScene for JS functions in scene events
  • keep only eventsFunctionContext for JS functions in scene events and expose getInstancesContainer() on eventsFunctionsContext. Make an invisible const runtimeScene = this._instanceContainer.getScene() to keep compatibility.
  • (bonus not linked to JS functions) Rework code generation to use eventsFunctionsContext.getInstancesContainer() instead of runtimeScene?
    • If we search "runtimeScene" in all .cpp/.h files, usage is already fairly low.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant