Exemplo n.º 1
0
        public void Render()
        {
            if (skinnedMeshRenderer.HasPropertyBlock())
            {
                skinnedMeshRenderer.GetPropertyBlock(materialPropertyBlock);
            }

            materialPropertyBlock.SetFloat("_Age", Time.time - snapshotTime);

            for (int subIndex = 0; subIndex < mesh.subMeshCount; subIndex++)
            {
                Graphics.DrawMesh(mesh, transform, sharedMaterials[subIndex], skinnedMeshRenderer.gameObject.layer, null, subIndex, materialPropertyBlock);
            }
        }