Closed GoogleCodeExporter closed 9 years ago
Mhmm Unity 4 seems to have introduced a messy garbage collection when stopping
a game in the Editor. I had the same issue with other stuff, though not with
HOTween. I think I know how to solve it, and should fix it quite quickly.
Original comment by daniele....@gmail.com
on 11 Jan 2013 at 8:55
[deleted comment]
( I deleted the last comment ) I did just get the same error even after copying
the files on this website.
Original comment by invadere...@gmail.com
on 11 Jan 2013 at 10:23
It actually seems to be a bug in Unity 4. But I made some changes that should
solve it. Can you check if the attached version (1.1.725) fixes it, since I
can't reproduce it?
Original comment by daniele....@gmail.com
on 12 Jan 2013 at 11:54
Attachments:
I still have the same problem, here is the error log:
!IsPlayingOrAllowExecuteInEditMode ()
(Filename: C:/BuildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp
Line: 587)
Destroy may not be called from edit mode! Use DestroyImmediate instead.
Also think twice if you really want to destroy something in edit mode. Since
this will destroy objects permanently.
UnityEngine.Object:Destroy(Object, Single)
UnityEngine.Object:Destroy(Object) (at
C:\BuildAgent\work\812c4f5049264fad\Runtime\ExportGenerated\Editor\UnityEngineOb
ject.cs:78)
Holoville.HOTween.HOTween:Clear()
Holoville.HOTween.HOTween:CheckClear()
Holoville.HOTween.HOTween:Update()
[C:/BuildAgent/work/812c4f5049264fad/Runtime/Scripting/ScriptingUtility.cpp
line 344]
(Filename:
C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/UnityEngineOb
ject.cs Line: 78)
!IsPlayingOrAllowExecuteInEditMode ()
(Filename: C:/BuildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp
Line: 587)
Original comment by invadere...@gmail.com
on 14 Jan 2013 at 6:57
Ouch! Have you tried with the newly released Unity 4.0.1 which fixes some bugs?
Original comment by daniele....@gmail.com
on 14 Jan 2013 at 7:03
I wasn't even aware of 4.0.1, let me download that, get back to you in a few
minutes
Original comment by invadere...@gmail.com
on 14 Jan 2013 at 7:07
Nope same problem, is there any other info I could provide you to help solve
the problem ?
Original comment by invadere...@gmail.com
on 14 Jan 2013 at 7:39
It's weird, with the new internal callback I added, using OnApplicationQuit,
Update shouldn't be called since HOTween should get cleared already.
If you could create a sample project that replicates the issue it would be
awesome! I can't seem to do that from here. If you can't, let me know, and I'll
try something else.
Original comment by daniele....@gmail.com
on 14 Jan 2013 at 8:24
Original comment by daniele....@gmail.com
on 14 Jan 2013 at 8:24
I'm having trouble reproducing the bug in a simpler separate test scene and I
cant send the bigger project since it belongs to the company I work for.
Original comment by invadere...@gmail.com
on 14 Jan 2013 at 10:05
Don't worry I'll try some test build to find a solution. Only thing: won't be
able to put my hands on it until Wednesday, since tomorrow I have a hell of a
day :P
Original comment by daniele....@gmail.com
on 14 Jan 2013 at 10:51
A small detail I just noticed if I set HOTween.Init( true);
at the start of the app I get these left over in my scene
HOTween : 0
instead of
HOTween : 1
thanks for the support.
Original comment by invadere...@gmail.com
on 15 Jan 2013 at 12:53
also I dont get the Destroy message in the log, just the other two :
!IsPlayingOrAllowExecuteInEditMode ()
(Filename: C:/BuildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp
Line: 587)
Some objects were not cleaned up when closing the scene
(Filename:
C:/BuildAgent/work/812c4f5049264fad/Runtime/Misc/SaveAndLoadHelper.cpp Line:
192)
Original comment by invadere...@gmail.com
on 15 Jan 2013 at 12:59
Interesting, thanks. That should definitely help me to isolate the problem.
Original comment by daniele....@gmail.com
on 15 Jan 2013 at 1:01
I tried following the suggestion here:
http://forum.unity3d.com/threads/124054-OnDestroy()-problem-on-Pickups
by adding:
if (tweenGOInstance != null && !isShuttingDown)
to line 2084 of HOTween.cs
and
static bool isShuttingDown = false;
void OnApplicationQuit()
{
isShuttingDown = true;
}
This seems to make the bug happen less often, but still happens... ( let me
know if I should stop posting these and just wait till Wednesday ) .
Original comment by invadere...@gmail.com
on 15 Jan 2013 at 1:16
Last thing I noticed (after changes above):
In my scene one of the first things that happen is that I have an alpha fade
and a music fade in, I use the tweens for those two and I get a Hotween : 2 ,
most times if I quit the app when I can see the Hotween : 2, then the app will
end with out errors. If I wait for both tweens to be over, and then I quit the
app I can reproduce the error almost every time.
I assume that after the tweens are gone, there shouldnt really be anything to
erase, so dont understand why I suddenly would get a new tween Hotween : 1 at
that point that attempts to get erased then in edit mode.
Anyway, hopefully you can find something on wednesday.
Original comment by invadere...@gmail.com
on 15 Jan 2013 at 3:07
Last thing I noticed (after changes above):
In my scene one of the first things that happen is that I have an alpha fade
and a music fade in, I use the tweens for those two and I get a Hotween : 2 ,
most times if I quit the app when I can see the Hotween : 2, then the app will
end with out errors. If I wait for both tweens to be over, and then I quit the
app I can reproduce the error almost every time.
I assume that after the tweens are gone, there shouldnt really be anything to
erase, so dont understand why I suddenly would get a new tween instance Hotween
: 1 at that point that attempts to get erased then in edit mode.
Anyway, hopefully you can find something on wednesday.
Original comment by invadere...@gmail.com
on 15 Jan 2013 at 3:08
I *think* this version 1.1.726 should solve the issue. I used the suggestion
you implemented (though calling the property "quitting" instead than
"shuttingDown"), but while having it still clean everything up. If this doesn't
work, I have another idea of how to solve it, but I hope there won't be need
for it.
Let me know.
Original comment by daniele....@gmail.com
on 16 Jan 2013 at 4:08
Attachments:
hmmm I didnt get an email for that last comment = (
I still get the error below and the leftover gameobject:
Some objects were not cleaned up when closing the scene
(Filename:
C:/BuildAgent/work/812c4f5049264fad/Runtime/Misc/SaveAndLoadHelper.cpp Line:
192)
Original comment by invadere...@gmail.com
on 21 Jan 2013 at 10:33
Ouch, damn mails :(
Anyway, here is another version with a different type of check. If this doesn't
work, it means I'm looking at the problem from a totally wrong side.
Let me know :)
Original comment by daniele....@gmail.com
on 22 Jan 2013 at 11:03
Attachments:
So works a little bit better, like I mentioned in the comment #18 above if
there are tweens running and I stop the app then no error, if there are no
tweens running and I stop the app I get the same error.
Original comment by invadere...@gmail.com
on 23 Jan 2013 at 7:06
= / I really don't seem to get this problem with other tweens in the app except
the ones associated with sound, maybe I'm just doing something stupid, I'm
going to attach my "SoundManager" class here, maybe take a look see if I'm
doing something wrong here.
Original comment by invadere...@gmail.com
on 23 Jan 2013 at 7:16
Attachments:
Hey, sorry if this took me a while.
I'm attaching a beta version with another mod. In case that doesn't work, could
you try these different initialization approaches and tell me again the errors
you have with each one (or if some of those approaches solve it)?
1) HOTween.Init(false,false,false);
1) HOTween.Init(true,true,false);
1) HOTween.Init(true,false,false);
I also went through your SoundManager class, but it seems everything's ok there.
Original comment by daniele....@gmail.com
on 30 Jan 2013 at 10:41
Attachments:
730b with no Init behaves same as #22
Init(false,false,false) = same as #22 only difference is the leftover object
just says "Hotween" with no extra number
Init(true,true,false) = Yay! this seems to work, I notice that Hotween: 0 stays
around preventing the possible fail scenario ?
Init(true,false,false) = this seems to work too, I notice that Hotween stays
around
like above.
Thank you for taking the time to address this issue ! = ]
Original comment by ebe...@thirdmotion.com
on 30 Jan 2013 at 7:01
Very interesting: so Unity has issues when destroying HOTween while the Editor
player is closing. I should now be able to make a version which will work
regardless of the Init settings - though setting the first Init parameter to
true is the best thing to do for performance anyway ;)
Original comment by daniele....@gmail.com
on 6 Feb 2013 at 6:01
Back! Could you try the attached version 1.1.731, to see if it solves the bug
with Unity 4 completely? Try to set Init(false,false,false), and see what
happens: everything should hopefully work now.
Thanks :)
Original comment by daniele....@gmail.com
on 6 Feb 2013 at 6:09
Attachments:
still broken using Init(false,false,false) on 731
Original comment by invadere...@gmail.com
on 6 Feb 2013 at 6:56
actually 731 is worst than 730b, Init(true,true,false) doesn't work
Original comment by ebe...@thirdmotion.com
on 20 Feb 2013 at 12:46
Sorry if I'm being superlate, but these days are supermessy, and I'm taking
advantage of the fact that at least we know how to avoid the issue.
Thanks for the additional info. I hope to have time to try something else to
fix it permanently at the beginning of next week.
Original comment by daniele....@gmail.com
on 20 Feb 2013 at 11:43
Finally made some more changes. Could you check if
Init(true,true,false)
Init(true,false,false)
are working with this version? I don't care about Init(false...) because it's
just a waste of resources to set it to false, so next version won't allow it
(but will still keep that overload to avoid breaking older projects).
Thanks :)
Original comment by daniele....@gmail.com
on 23 Feb 2013 at 12:44
Attachments:
tried both:
Init(true,true,false)
Init(true,false,false)
they both have the same problems :
!IsPlayingOrAllowExecuteInEditMode ()
(Filename: C:/BuildAgent/work/812c4f5049264fad/Runtime/Mono/MonoBehaviour.cpp
Line: 587)
they leave the usual HOTween laying around... 730b is still the winner.
Sorry for not getting back, now that it works (730b) I forget to check here.
Original comment by invadere...@gmail.com
on 14 Mar 2013 at 6:50
Original comment by daniele....@gmail.com
on 11 Dec 2013 at 12:18
Original issue reported on code.google.com by
invadere...@gmail.com
on 11 Jan 2013 at 7:59