codebots-ltd/PDUnity

Blending issue on object set to active/disabled.

Opened this issue · 2 comments

When the object is set to disabled, and then re-enabled the blending values set on the editor seem to get lost. (This happens when testing on iOS, doesn't seem to happen on the preview view itself)

Same for android.
See the attached file to see the difference between regular particle effect and after the game object has been disabled and enabled.
Before: www.whysoseriousgames.de/PDUnity/PDUnity_before.png
After: www.whysoseriousgames.de/PDUnity/PDUnity_after.png

Fixed it by adding two lines about currentBlendSource and currentBlendDestiation to the method

  void ClearDown()
        {
            // Reset current blend modes.
            currentBlendDestination = -1;
            currentBlendSource = -1;

            this.emitterConfig = null;
            this.initialized = false;
        }