*

jjv

  • *
  • 3
    • View Profile
Using source code
« on: April 29, 2015, 03:10:08 AM »
Hi there,

I have a strange bug I'm trying to hunt down.

Some context:
I init all my Tweens and Sequences in Start() method of my objects. Before I exit the level I call  DOTween.Clear(true); otherwise when I return to my level with Application.LoadLevelAsync( nextScene ); I can see that tweens are keep growing and it eventually throws "array out of index" or something like that. I use Restart() method to restart tweens.

The issue:
Sometimes when I return to the level after exiting it all tween stop working. I can see in the debugger that tween object is there and Restart() method is called. Yet the tween is not restarting as OnComplete() is not called. There is no any errors in console. It just silently fails somewhere inside. The issue happens only sometimes. Let's say 1 time out of 10.

What I'm trying to do:
I would like to setup DOTween code and troubleshoot the issue further. Yet I'm having problem setting it up. I cloned github repo and now I'm stuck. Before I installed everything via package and Assets\Demigiant\DOTween had Editor folder and bunch of DLLs. I removed dlls and copied over files from https://github.com/Demigiant/dotween/tree/develop/_DOTween.Assembly/DOTween. It complains about "Assets/Demigiant/DOTween/ShortcutExtensions.cs(997,28): error CS0121: The call is ambiguous between the following methods or properties: `DG.Tweening.DOTween.Restart(object, bool)' and `DG.Tweening.DOTween.Restart(object, object, bool)'"
I thought I alls need to overlay https://github.com/Demigiant/dotween/blob/develop/_DOTween.Assembly/DOTween50/ShortcutExtensions.cs yet I get another error "error CS1061: Type `UnityEngine.AudioSource' does not contain a definition for `DOFade' and no extension method `DOFade' of type `UnityEngine.AudioSource' could be found (are you missing a using directive or an assembly reference?)
"

At this point I stopped guessing and decided to ask for some help in setting things up with source code.

Please advice.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Using source code
« Reply #1 on: April 29, 2015, 03:52:51 PM »
Hi,


DOTween's source code needs to be compiled in a DLL, because lose scripts don't support some of the features that DLLs do, and that's why those errors are happening. You could use the solution that comes with the source code and set it up in Visual Studio (or MonoDevelop).


That said, if you could create a sample project that replicates this issue and send it to me it would be great: I will squash the bug asap.


Cheers,
Daniele

*

jjv

  • *
  • 3
    • View Profile
Re: Using source code
« Reply #2 on: April 30, 2015, 03:40:36 AM »
I'm an idiot. During my optimization spree I removed .SetAutoKill(false) on some of the sequences. So it works the first time but not the second...

When you switch to verbose log it actually says "DOTWEEN :: This Tween has been killed and is now invalid" This should probably be an error and not warning?

On a flip side it was good educational experience as I was able to debug DLLs (I'm new to VS and Unity). This article was helpful http://unityvs.com/documentation/dll-debugging/

Thanks!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Using source code
« Reply #3 on: April 30, 2015, 09:03:29 PM »
Wooooh I had no idea UnityVS allowed breakpoints in DLLs! That is supercool, thanks for the tip :)

About "DOTWEEN :: This Tween has been killed and is now invalid", that is a warning and not an error because it doesn't throw an exception nor stops running some piece of code, but simply warns you that the operation you tried to do was ignored, and for what reason.