コード例 #1
0
 public GraphNestEditor(Metadata metadata) : base(metadata)
 {
 }
コード例 #2
0
 public static Inspector Inspector(this Metadata metadata)
 {
     return(InspectorProvider.instance.GetDecorator(metadata));
 }
コード例 #3
0
 public UnknownInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #4
0
 public Ray2DInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #5
0
 public EnumInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #6
0
 public virtual Inspector GetPortInspector(IUnitPort port, Metadata metadata)
 {
     return(metadata.Inspector());
 }
コード例 #7
0
ファイル: Metadata.cs プロジェクト: hyop30/Platformer-Loglike
        // Using TSubpath to avoid boxing and alloc of object
        protected TMetadata Dig <TSubpath, TMetadata>(TSubpath subpath, Func <Metadata, TMetadata> constructor, bool createInPrefab, Metadata prefabInstance = null) where TMetadata : Metadata
        {
            if (subpath == null)
            {
                throw new ArgumentNullException(nameof(subpath));
            }

            if (constructor == null)
            {
                throw new ArgumentNullException(nameof(constructor));
            }

            var subhash = subpath.GetHashCode();

            Metadata child;

            if (children.TryGetValue(subhash, out child))
            {
                if (child is TMetadata)
                {
                    return((TMetadata)child);
                }
                else
                {
                    throw new InvalidOperationException($"Metadata mismatch: expected '{typeof(TMetadata).Name}', found '{child.GetType().Name}'.");
                }
            }
            else
            {
                try
                {
                    var containsBefore = children.Contains(subhash);

                    child = constructor(this);

                    if (!containsBefore && children.Contains(child.subhash))
                    {
                        throw new InvalidOperationException($"Children didn't contain '{subpath}' subpath before the constructor but now does.");
                    }

                    child.CachePath();
                    child.AnalyzeCollection();

                    if (isPrefabInstanceWithDefinition)
                    {
                        if (createInPrefab)
                        {
                            child.prefabDefinition = prefabDefinition.Dig(subpath, constructor, false, child);
                        }
                        else if (prefabDefinition.children.Contains(subhash))
                        {
                            child.prefabDefinition = prefabDefinition.children[subhash];
                        }
                        else
                        {
                            child.isPrefabInstanceWithoutDefinition = true;
                        }
                    }
                    else if (isPrefabInstanceWithoutDefinition)
                    {
                        child.isPrefabInstanceWithoutDefinition = true;
                    }

                    children.Add(child);

                    if (PluginContainer.initialized && BoltCore.Configuration.developerMode && BoltCore.Configuration.trackMetadataState)
                    {
                        Debug.LogWarningFormat
                        (
                            "Created {0} node{1}:\n{2}",
                            child.GetType().CSharpName(false),
                            child.isPrefabInstance ? " (prefab instance)" : (prefabInstance != null ? " (prefab definition)" : ""),
                            child
                        );
                    }

                    return((TMetadata)child);
                }
                catch
                {
                    // If digging fails and we're creating a prefab definition mirror,
                    // we will simply notify the instance metadata that it has no hierarchy equivalent.
                    if (prefabInstance != null)
                    {
                        prefabInstance.isPrefabInstanceWithoutDefinition = true;
                        return(null);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }
コード例 #8
0
 public InspectorBlock(Metadata metadata, Rect position)
 {
     this.metadata = metadata;
     this.position = position;
 }
 public ImplementationInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #10
0
ファイル: Metadata.cs プロジェクト: hyop30/Platformer-Loglike
 public ProxyMetadata Proxy(object subpath, Metadata binding)
 {
     return(Dig(subpath, parent => new ProxyMetadata(subpath, binding, parent), false));
 }
コード例 #11
0
 public UnityObjectInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #12
0
 public VariableDeclarationInspector(Metadata metadata)
     : base(metadata)
 {
     VSUsageUtility.isVisualScriptingUsed = true;
 }
 public VariableDeclarationInspector(Metadata metadata) : base(metadata)
 {
 }
コード例 #14
0
 public static TInspector Inspector <TInspector>(this Metadata metadata) where TInspector : Inspector
 {
     return(InspectorProvider.instance.GetDecorator <TInspector>(metadata));
 }
コード例 #15
0
 public ListInspector(Metadata metadata) : base(metadata)
 {
     adaptor = new MetadataListAdaptor(metadata, this);
 }
コード例 #16
0
 public static bool HasInspector(this Metadata metadata)
 {
     return(InspectorProvider.instance.HasInspector(metadata.definedType));
 }
コード例 #17
0
 public KeyValuePairInspector(Metadata metadata) : base(metadata)
 {
 }