コード例 #1
0
        private ImportedInspectorValues ProcessPrefabModifications(IPsiSourceFile currentSourceFile, AssetDocument assetDocument)
        {
            var result = new ImportedInspectorValues();

            if (assetDocument.HierarchyElement is IPrefabInstanceHierarchy prefabInstanceHierarchy)
            {
                foreach (var modification in prefabInstanceHierarchy.PrefabModifications)
                {
                    if (!(modification.Target is ExternalReference externalReference))
                    {
                        continue;
                    }

                    if (modification.PropertyPath.Contains("."))
                    {
                        continue;
                    }

                    var location = new LocalReference(currentSourceFile.PsiStorage.PersistentIndex.NotNull("owningPsiPersistentIndex != null"), PrefabsUtil.GetImportedDocumentAnchor(prefabInstanceHierarchy.Location.LocalDocumentAnchor, externalReference.LocalDocumentAnchor));
                    result.Modifications[new ImportedValueReference(location, modification.PropertyPath)] = (modification.Value, new AssetReferenceValue(modification.ObjectReference));
                }
            }

            return(result);
        }
コード例 #2
0
        private static object Read(UnsafeReader reader)
        {
            var count = reader.ReadInt32();
            var list  = new List <InspectorVariableUsage>(count);

            for (int i = 0; i < count; i++)
            {
                list.Add(reader.ReadPolymorphic <InspectorVariableUsage>());
            }

            var importedInspectorValues = ImportedInspectorValues.ReadFrom(reader);
            var result = new AssetInspectorValuesDataElement(list, importedInspectorValues);

            return(result);
        }
コード例 #3
0
 private AssetInspectorValuesDataElement(List <InspectorVariableUsage> inspectorValues,
                                         ImportedInspectorValues importedInspectorValues)
 {
     ImportedInspectorValues = importedInspectorValues;
     myVariableUsages        = inspectorValues;
 }
コード例 #4
0
 public InspectorValuesBuildResult(LocalList <InspectorVariableUsage> inspectorValues, ImportedInspectorValues importedInspectorValues)
 {
     InspectorValues         = inspectorValues;
     ImportedInspectorValues = importedInspectorValues;
 }