Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug with listener
#4
Hi,

I found the cause behind your issue, and have a workaround for you:

The cause:
when you enable the SplineController via code, Unity calls the SplineController 's Start() method the next frame, which reinitializes the controller, cancelling your call to Play() the previous frame.

The workaround:
  • Without modifying Curvy: Do not call controller.enable = true and controller.Play() in the same frame
  • While modifying Curvy: Here are some code modifications that will avoid you the issue, but keep in mind that this is just a quick fix, which means that it wasn't thought about thoroughly (to find all the side effects) and not tested at length.
          In SplineController.cs, replace OnEnable's implementation with this:      
Code:
               protected override void OnEnable()
               {
                   base.OnEnable();
                   BindEvents();

                   if (IsConfigured && DependenciesInitialized)
                       Prepare();
               }
               In the same class, replace Prepare() with this      
Code:
               public override void Prepare()
               {
                   if (mIsPrepared)
                       return;

                   BindEvents();
                   base.Prepare();
                   mKeepDistanceAt = 0;
               }


The proper fix:
The real fix to this will not be in the next update. Right now, and for the first time since I acquired Curvy in January, I am doing fundamental refactoring to fix a whole class of bugs (instead of hunting individual bugs, which are just the symptoms of the root issues) and to improve performance in a major way. Such work takes time. The next update will have such work done on the Splines code, since it is the most fundamental code in the package. Once this work is done, I will start doing fundamental refactoring on controllers, including SplineController.

Please let me know if neither one of the workarounds worked with you.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Bug with listener - by lllApOlll - 03-30-2018, 10:18 AM
RE: Bug with listener - by _Aka_ - 03-30-2018, 10:58 AM
RE: Bug with listener - by lllApOlll - 03-30-2018, 11:18 AM
RE: Bug with listener - by _Aka_ - 04-04-2018, 01:08 PM
RE: Bug with listener - by _Aka_ - 05-24-2018, 05:36 PM

Forum Jump: