void UpdateStatusChecks(GameObject prefabInstanceRoot)
        {
            // Can't reset values inside this method, since it's called consecutively for each target.

            if (PrefabUtility.HasPrefabInstanceAnyOverrides(prefabInstanceRoot, false))
            {
                m_AnyOverrides = true;
            }
            if (PrefabUtility.HasInvalidComponent(prefabInstanceRoot))
            {
                m_InvalidComponentOnInstance = true;
            }

            GameObject prefabAssetRoot = PrefabUtility.GetCorrespondingObjectFromSource(prefabInstanceRoot);

            if (PrefabUtility.IsPartOfModelPrefab(prefabAssetRoot))
            {
                m_ModelPrefab = true;
            }
            if (PrefabUtility.IsPartOfImmutablePrefab(prefabAssetRoot))
            {
                m_Immutable = true;
            }
            if (PrefabUtility.HasInvalidComponent(prefabAssetRoot))
            {
                m_InvalidComponentOnAsset = true;
            }

            if (PrefabUtility.HasManagedReferencesWithMissingTypes(prefabAssetRoot))
            {
                m_HasManagedReferencesWithMissingTypesOnAsset = true;
            }

            m_HasApplicableOverrides = m_TreeView == null || m_TreeView.hasApplicableModifications;
        }
Beispiel #2
0
        protected override void Awake()
        {
            base.Awake();

            m_ContainsMissingSerializeReferenceType = false;
            foreach (var prefabAssetRoot in assetTargets)
            {
                if (PrefabUtility.HasInvalidComponent(prefabAssetRoot))
                {
                    m_PrefabsWithMissingScript.Add(AssetDatabase.GetAssetPath(prefabAssetRoot));
                }

                if (PrefabUtility.IsPartOfPrefabAsset(prefabAssetRoot) && PrefabUtility.HasManagedReferencesWithMissingTypes(prefabAssetRoot))
                {
                    m_ContainsMissingSerializeReferenceType = true;
                }
            }
            m_PrefabsWithMissingScript.Sort();
        }