Exemple #1
0
        public void UpdateRenderersCollection()
        {
            if (meshRootGameObjectValue != null)
            {
                renderers   = meshRootGameObjectValue.GetComponentsInChildren <Renderer>(true);
                meshFilters = meshRootGameObjectValue.GetComponentsInChildren <MeshFilter>(true);

                RecalculateBounds();
                OnAnyUpdated?.Invoke();
                OnUpdated?.Invoke();
            }
        }
Exemple #2
0
        public void UpdateRenderersCollection()
        {
            if (meshRootGameObjectValue != null)
            {
                renderers   = meshRootGameObjectValue.GetComponentsInChildren <Renderer>(true);
                meshFilters = meshRootGameObjectValue.GetComponentsInChildren <MeshFilter>(true);

                TextMeshPro[] tmpros = meshRootGameObjectValue.GetComponentsInChildren <TextMeshPro>(true);
                if (tmpros.Length > 0)
                {
                    renderers   = renderers.Union(tmpros.Select(x => x.renderer)).ToArray();
                    meshFilters = meshFilters.Union(tmpros.Select(x => x.meshFilter)).ToArray();
                }

                RecalculateBounds();
                OnAnyUpdated?.Invoke();
                OnUpdated?.Invoke();
            }
        }