Hello! I have a SpriteRenderer with a SpriteFader attached. I had assumed that RememberVisibility would store the colour values of the SpriteRenderer (and I think it does, actually?)
However, if I boot up a scene with a SpriteRenderer with the alpha channel set to 0, save it and immediately load it, the spriteRenderer's colour alpha gets set to 1.
Is there a better Remember component I should be using for SpriteFaders? I'm not using the Visibility functionality, just looking to serialise a SpriteRenderer's colour.
Ta!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Digging in a little more. It looks like my issue is actually down to the fact that SpriteFader.isFading is getting returned as true, causing RememberVisibility to declare the SpriteFader to be mid-fade, which then ignores the colour value in favour of using the FadeAlpha on Sprite Fader. BUT I've confirmed that DoFade never gets started.
Looks like SpriteFader.isFading is declared true at the top of the file. Changing that to false I thiiiiiink fixes my issue.
Is there a reason I'm not seeing why it's true and I therefore shouldn't mess with it? ;D
Here's what I've done:
Commenting that out basically means RememberVisibility will store the SpriteRenderer's colour, even if there's a SpriteFader attached. Then, with isFading set to false, I think we're good? Does that mess anything else up I haven't considered?
IIRC the prevention of the "Save colour/alpha" option was hidden in the case of a SpriteFader component to prevent conflict, as they both deal with shared data, but revisiting this it's probably fine to have this - so long as the effects of saveColour are applied before that of the SpriteFader component in the LoadData method (both the Save and Load methods will need to be also amended to allow both at the same time).
I don't see a problem with this, I'll make these changes to v1.82 - thanks for raising the issue.
Ace, thanks Chris.