备份,准备做双端
This commit is contained in:
@@ -51,6 +51,14 @@ public class DissolveEffectController : MonoBehaviour
|
||||
private float timer;
|
||||
private bool playing;
|
||||
|
||||
// Track on-screen visibility so the continuous OutlinePulse write is skipped when the
|
||||
// renderer is offscreen (nothing would be seen anyway). Assume visible until Unity tells
|
||||
// us otherwise, so effects on objects that never entered the culling system still animate.
|
||||
private bool isVisible = true;
|
||||
|
||||
private void OnBecameVisible() { isVisible = true; }
|
||||
private void OnBecameInvisible() { isVisible = false; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
targetRenderer = GetComponent<Renderer>();
|
||||
@@ -85,7 +93,7 @@ public class DissolveEffectController : MonoBehaviour
|
||||
{
|
||||
if (effect == Effect.OutlinePulse)
|
||||
{
|
||||
UpdatePulse();
|
||||
if (isVisible) UpdatePulse();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user