void IAssetNodeInternal.SetPropertyGraph(AssetPropertyGraph assetPropertyGraph) { if (assetPropertyGraph == null) { throw new ArgumentNullException(nameof(assetPropertyGraph)); } PropertyGraph = assetPropertyGraph; }
public void RefreshBase(AssetPropertyGraph baseAssetGraph) { // Unlink previously linked nodes foreach (var linkedNode in baseLinkedNodes.Where(x => x.Value != null)) { linkedNode.Key.BaseContent.Changed -= linkedNode.Value; } baseLinkedNodes.Clear(); baseGraph = baseAssetGraph; // Link nodes to the new base. // Note: in case of composition (prefabs, etc.), even if baseAssetGraph is null, each part (entities, etc.) will discover // its own base by itself via the FindTarget method. LinkToBase(RootNode, baseAssetGraph?.RootNode); }
public void RestoreOverrides(List <NodeOverride> overridesToRestore, AssetPropertyGraph archetypeBase) { foreach (var clearedOverride in overridesToRestore) { // TODO: this will need improvement when adding support for Seal switch (clearedOverride.Target) { case OverrideTarget.Content: clearedOverride.Node.OverrideContent(true); break; case OverrideTarget.Item: clearedOverride.Node.OverrideItem(true, clearedOverride.Index); break; case OverrideTarget.Key: clearedOverride.Node.OverrideKey(true, clearedOverride.Index); break; default: throw new ArgumentOutOfRangeException(); } } }
public AssetToBaseNodeLinker(AssetPropertyGraph propertyGraph) { this.propertyGraph = propertyGraph; }
public AssetToBaseNodeLinker(AssetPropertyGraph propertyGraph) { this.propertyGraph = propertyGraph; }
public void RegisterGraph(AssetId assetId, AssetPropertyGraph graph) { registeredGraphs.Add(assetId, graph); }
public void RefreshBase(AssetPropertyGraph baseAssetGraph) { // Unlink previously linked nodes foreach (var linkedNode in baseLinkedNodes.Where(x => x.Value != null)) { linkedNode.Key.BaseContent.Changed -= linkedNode.Value; } baseLinkedNodes.Clear(); baseGraph = baseAssetGraph; // Link nodes to the new base. // Note: in case of composition (prefabs, etc.), even if baseAssetGraph is null, each part (entities, etc.) will discover // its own base by itself via the FindTarget method. LinkToBase(RootNode, baseAssetGraph?.RootNode); }