mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[unity] Fixed SkeletonGraphic Update When Invisible not working. Now it uses onCullStateChanged, which can be used with RectMask2D. Closes #1910.
This commit is contained in:
parent
878c862af4
commit
b3f76c4e54
@ -202,7 +202,8 @@ namespace Spine.Unity {
|
||||
protected override void Awake () {
|
||||
|
||||
base.Awake ();
|
||||
updateMode = updateWhenInvisible;
|
||||
this.onCullStateChanged.AddListener(OnCullStateChanged);
|
||||
|
||||
SyncRawImagesWithCanvasRenderers();
|
||||
if (!this.IsValid) {
|
||||
#if UNITY_EDITOR
|
||||
@ -313,6 +314,13 @@ namespace Spine.Unity {
|
||||
UpdateMesh();
|
||||
}
|
||||
|
||||
protected void OnCullStateChanged (bool culled) {
|
||||
if (culled)
|
||||
OnBecameInvisible();
|
||||
else
|
||||
OnBecameVisible();
|
||||
}
|
||||
|
||||
public void OnBecameVisible () {
|
||||
updateMode = UpdateMode.FullUpdate;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user