Пример #1
0
        void UpdateStatusChecks(GameObject prefabInstanceRoot)
        {
            if (PrefabUtility.HasPrefabInstanceAnyOverrides(prefabInstanceRoot, false))
            {
                m_AnyOverrides = true;
            }
            if (PrefabUtility.IsDisconnectedFromPrefabAsset(prefabInstanceRoot))
            {
                m_Disconnected = 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;
            }
        }
        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.IsDisconnectedFromPrefabAsset(prefabInstanceRoot))
            {
                m_Disconnected = 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;
            }
        }
        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;
        }
        protected override void Awake()
        {
            base.Awake();

            foreach (var prefabAssetRoot in assetTargets)
            {
                if (PrefabUtility.HasInvalidComponent(prefabAssetRoot))
                {
                    m_PrefabsWithMissingScript.Add(AssetDatabase.GetAssetPath(prefabAssetRoot));
                }
            }
            m_PrefabsWithMissingScript.Sort();
        }
        internal PrefabOverridesWindow(GameObject selectedGameObject)
        {
            m_SelectedGameObject = selectedGameObject;
            m_TreeViewState      = new TreeViewState();
            m_TreeView           = new PrefabOverridesTreeView(selectedGameObject, m_TreeViewState);

            GameObject prefabAssetRoot = PrefabUtility.GetCorrespondingObjectFromSource(m_SelectedGameObject);

            m_TreeView.SetApplyTarget(m_SelectedGameObject, prefabAssetRoot, AssetDatabase.GetAssetPath(prefabAssetRoot));

            UpdateText(prefabAssetRoot);

            m_Immutable = PrefabUtility.IsPartOfImmutablePrefab(prefabAssetRoot);
            m_InvalidComponentOnInstance = PrefabUtility.HasInvalidComponent(m_SelectedGameObject);
            m_InvalidComponentOnAsset    = PrefabUtility.HasInvalidComponent(prefabAssetRoot);
        }
Пример #6
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();
        }