Skip to content

added cameraPosition function#189

Merged
olexale merged 1 commit into
olexale:masterfrom
alegos27:master
May 1, 2023
Merged

added cameraPosition function#189
olexale merged 1 commit into
olexale:masterfrom
alegos27:master

Conversation

@alegos27
Copy link
Copy Markdown
Contributor

Added a native function that return camera position as Vector3

Copy link
Copy Markdown
Owner

@olexale olexale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you for this contribution!

Please change cameraPosition just a bit and I'll be happy to push a new version with these changes 👍

Comment on lines +745 to +747
final result = await _channel.invokeMethod('cameraPosition');
if(result != null) {
return _vector3Converter.fromJson(result!);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_vector3Converter.fromJson expects a List, hence please use invokeListMethod.

Dart is smart enough not to make you force unwrap the result.

So that could be:

    final result = await _channel.invokeListMethod('cameraPosition');
    if(result != null) {
      return _vector3Converter.fromJson(result);

Would you please try it to check whether it still works?

@olexale olexale merged commit 0485c76 into olexale:master May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants