Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable LegacyAnimateSpriteRenderer when !IsVisible & VolumeWithDistance on Dead Enemies #215

Open
wants to merge 1 commit into
base: nightly
Choose a base branch
from

Conversation

DonKaiStorm
Copy link

When objects that use LegacyAnimateSpriteRenderer are collected or killed (like coins for example), they still update the Sprite Renderer, despite not needing to. This makes it so that the updating of the Sprite Renderer is only done when on object is currently visible.
(NOTE: If you aren't seeing an improvement/difference in the Unity Editor, move the Scene View camera away from the level, as that also triggers the Object's isVisible tag.)

In addition, this commit also disables the VolumeWithDistance component for dead enemies and collected coins, since there would be no point in updating the volume of an object that can't be interacted with.

…ies and Collected Coins

When objects that use LegacyAnimateSprite Renderer are collected or killed (like coins for example), they still update the Sprite Renderer despite not needing too. This fixes that.

In addition, also disabled VolumeWithDistance for dead enemies or collected coins, since there would be no point in doing so as their sound effects couldn't be played in that state.
@DonKaiStorm DonKaiStorm changed the title Disable LegacyAnimateSpriteRenderer when NotVisible & VolumeWithDistance on Dead Enemies Disable LegacyAnimateSpriteRenderer when !IsVisible & VolumeWithDistance on Dead Enemies Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant