Closed sekkit closed 5 years ago
IT is confirmed that using your MonoBehaviour Messages old tree's code. No longer crashes. But the feature & bugfixes seemed to be hard to merge back due to API's breaking change...
With the latest master version, the CodeGen cannot generate from the config file attached below .. seems the compatibiliy was broken (feature lost) since your <Commits on Mar 12, 2018> NativeScriptTypes.zip lost)
If i do not call addcomponent, it worked well. But when I addcomponent(a monobehaviour added to scene), and stop playing, and replaying, this issue will ocur.
I haven't noticed any crash when stopping playing on Windows, at least with the example in the repo. Can you please describe more about your testing environment and the changes you made to the repo to get the crash to happen?
IT is confirmed that using your MonoBehaviour Messages old tree's code. No longer crashes. But the feature & bugfixes seemed to be hard to merge back due to API's breaking change...
With the latest master version, the CodeGen cannot generate from the config file attached below .. seems the compatibiliy was broken (feature lost) since your <Commits on Mar 12, 2018> NativeScriptTypes.zip lost)
Can you be more specific than "your MonoBehaviour Messages old tree's code"? For example, which commit introduced the issue? Even better would be to tell me specifically what the issue is, ideally in the form of a PR that fixes it. :)
In this commit you deleted the obsolete implementation of MonoBehaviour. Using Generic BaseType way instead.
That caused the problem. I have trouble re-merge that deleted code back cause lot of things changed.
The error stack shows the BaseBallScript object has bugs in memory management. Null pointer I guess.
Since this commit as the picture shows^^
(PS: I'm using python binding against UnityNativeScript, and your Old implementation is totally working. Maybe I can mail you the DEMO project to debug)
Thanks for pointing out the offending commit. That corresponds to this article that details how the new functionality works and how it's much more featureful than the MonoBehaviour
-specific functionality that was replaced. The project won't go back to the old way, but I'm interested in fixing bugs in the new way.
I received your example project but wasn't able to reproduce the issue. Here's what I did:
cd /path/to/project/Libs
then sh gen_all.sh
. Apparently everything successfully built.startup_scene
BootScene
Exception: Couldn't open native library: /path/to/project/Assets/Plugins/Editor/NativeScript.bundle/Contents/MacOS/NativeScript
Please let me know what I should do differently to reproduce the issue.
Plz check my mail for a well configured OSX project. along with detailed steps to configure the project.
Finally u just run ln -s Scripts to Assets/StreamingAssets/Scripts to enable python scripts to be found...
now it runs
To summarize some e-mail threads with @sekkit: the provided project couldn't be made to work with a reasonable level of effort due to considerable issues configuring it. Please provide a test project that doesn't require configuration, such as by tweaking the code in the repro to show the issue.
Hi, i already give your the approach to do that. Way 1: drag the xcodeproject file(that very single file) to VSCode. search /Users/xxxx replace with your real path DONE
coz it's configured with CMake, so i reckon it's the only way to make it work on your environment. This code is definitely tweaked from your code, even the CMakeFileList.txt, only added few lines...
OR: please provide me with your localpath, the path you put my project. I will modify it and resend to you^^
If I were you, troubled by xcode, whatever issue it is. I will USE a Windows PC to get rid of that configuration...basically no config stuff needed
I believe I've found the source of the issue. BootScript.OnApplicationQuit
was being called before your OnDestroy
function. This caused your OnDestroy
to try to call into the native library after it was closed by BootScript.OnApplicationQuit
.
I just pushed 74d7d4a93c1d63c029fdff3bb522da779a98e402 which replaces BootScript.OnApplicationQuit
with listening to EditorApplication.playModeStateChanged
for when the state returns to PlayModeStateChange.EnteredEditMode
. This seems to only happen after OnDestroy
messages are sent to each MonoBehaviour
, so the native library won't be closed while you're handling that message.
great!
If i do not call addcomponent, it worked well. But when I addcomponent(a monobehaviour added to scene), and stop playing, and replaying, this issue will ocur.