imagicbell / ublockly

reimplementation of google blockly for Unity
http://imagicbell.github.io/unity/2017/10/11/blockly-one.html
Apache License 2.0
140 stars 54 forks source link

After resetting the workspace, the code keeps running without any blocks #13

Closed toamig closed 3 years ago

toamig commented 3 years ago

When I switch scenes and reset the workspace and create a new one, this green ligh stays there and the code keeps running even without any blocks. Am I supposed to do anything else to prevent this from happening?

Imgur

imagicbell commented 3 years ago

Sorry for the mess of disposing workspace. Lacking test :) Please check this new commit.

toamig commented 3 years ago

No problem at all, bugs happen quite a lot, it's perfectly understandable! Thank you so much for ur constant support and for letting us use your work!

Just another doubt to be clarified, what is the propper way of resetting the workspace now with the new code?

I'm handling events from the WorkspaceView for when I'm transitioning in and out of Ublockly's interface. What methods should I assign to each event?

imagicbell commented 3 years ago

Just the same as I said last time. I also add it here with a little bit new code modifications.

  1. If you need to switch scenes, which means WorkspaceView will be destroyed and re-created, you can follow the Brutal way.
  2. If you don't want to destroy the WorkspaceView object, you can just follow the second method: Reset block views and toolbox respectively.
toamig commented 3 years ago

Btw do you have any idea why these tests are failing? I don't think we changed anything related to this. Were they passing on your project? Imgur

imagicbell commented 3 years ago

Yes, mine is passed. image There must be some log to get a hint?

toamig commented 3 years ago

I'm getting this for some reason Imgur

Imgur

imagicbell commented 3 years ago

Sorry that I couldn't figure out what is wrong. Could you please check if you have changed class FieldAngle or class Number. Or you could debug into the code to check what is going wrong.