Exemplo n.º 1
0
        void LateUpdate()
#endif
        {
            if (m_SpriteRenderer.isVisible)
            {
                if (m_CurrentDeformSprite != sprite)
                {
                    DeactivateSkinning();
                    m_CurrentDeformSprite = sprite;
                    UpdateSpriteDeform();
                }
                if (isValid && !batchSkinning && this.enabled)
                {
                    var transformHash     = SpriteSkinUtility.CalculateTransformHash(this);
                    var spriteVertexCount = sprite.GetVertexStreamSize() * sprite.GetVertexCount();
                    if (spriteVertexCount > 0 && m_TransformsHash != transformHash)
                    {
                        var inputVertices = GetDeformedVertices(spriteVertexCount);
                        SpriteSkinUtility.Deform(sprite, gameObject.transform.worldToLocalMatrix, boneTransforms, ref inputVertices);
                        SpriteSkinUtility.UpdateBounds(this, transform.worldToLocalMatrix, rootBone.localToWorldMatrix);
                        InternalEngineBridge.SetDeformableBuffer(spriteRenderer, inputVertices);
                        m_TransformsHash      = transformHash;
                        m_CurrentDeformSprite = sprite;
                    }
                }
            }
        }
Exemplo n.º 2
0
        void LateUpdate()
#endif
        {
            CacheCurrentSprite();
            if (isValid && !batchSkinning && this.enabled && (this.alwaysUpdate || this.spriteRenderer.isVisible))
            {
                var transformHash     = SpriteSkinUtility.CalculateTransformHash(this);
                var spriteVertexCount = sprite.GetVertexStreamSize() * sprite.GetVertexCount();
                if (spriteVertexCount > 0 && m_TransformsHash != transformHash)
                {
                    var inputVertices = GetDeformedVertices(spriteVertexCount);
                    SpriteSkinUtility.Deform(sprite, gameObject.transform.worldToLocalMatrix, boneTransforms, inputVertices.array);
                    SpriteSkinUtility.UpdateBounds(this, inputVertices.array);
                    InternalEngineBridge.SetDeformableBuffer(spriteRenderer, inputVertices.array);
                    m_TransformsHash      = transformHash;
                    m_CurrentDeformSprite = GetSpriteInstanceID();
                }
            }
        }