- Modifié
Anything need to take care when using UpdateWhenVisible?
I tried to set UpdateWhenVisible in SkeletonGraphic to Nothing but I still get spine timeline event call backs. It seems like the off screen skeleton is still running everything. Although I can't see the visual due to scrollview clipping, I have Debug.Log on the spine event call back function so I can tell the timeline is still running.
The SkeletonGraphics are inside a ScrollView and the supposed invisible objects are dragged way off the clipping area, even outside the screen area. UpdateWhenVisible should trigger and turn off spine processing but its like the setting has no effect at all. Thus I want to know if there is anything I need to be careful when using UpdateWhenVisible? And is there any where I can look into to track whats causing the problem.
Update:
I dragged the object outside the ScrollView and placed it directly under the Canvas node but the issue still exist. It should not be related to ScrollView.
SkeletonGraphic
relies on the onCullStateChanged
callback. It seems that Unity unfortunately only issues this callback when entering or exiting a RectMask2D
area, but does nothing if a normal Mask
is used, even when the area outside is not rendered. So the solution should be to add RectMask2D
component at your Mask
GameObect as well.
When I tried adding RectMask2D to the Mask node, the spine object will become invisible even half of the image is still inside the scroll view area. I think it is caused by the calculation not using the area of the spine visible pixels but using the RectTransform's rect which is default to 100x100. If this is the case, is there any function I can call to have the game object auto adjust to enclose the entire visible part?
Please see the documentation page:
http://esotericsoftware.com/spine-unity#Match-RectTransform-bounds-for-correct-visibility