Пример #1
0
        internal static void ConversionIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
        {
            //Custom finding of all default Material properties on every single object type including custom types
            if (MaterialReferenceBuilder.MaterialReferenceLookup.TryGetValue(context.targetType, out var methods))
            {
                foreach (var method in methods)
                {
                    if (method == null)
                    {
                        continue;
                    }

                    var result = method.GetMaterialFromMethod(context.target, (methodName, objectName) =>
                                                              $"The method {methodName} was not found on {objectName}. This property will not be indexed.");

                    if (result is Material materialResult)
                    {
                        if (materialResult != null && MaterialReferenceBuilder.GetIsReadonlyMaterial(materialResult))
                        {
                            indexer.AddProperty("urp", "convert-readonly", context.documentIndex);
                        }
                    }
                    else if (result is Material[] materialArrayResult)
                    {
                        foreach (var material in materialArrayResult)
                        {
                            if (material != null && MaterialReferenceBuilder.GetIsReadonlyMaterial(material))
                            {
                                indexer.AddProperty("urp", "convert-readonly", context.documentIndex);
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
        internal static void ConversionIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
        {
            // Note: Volumes and Layers on the same object would still produce only a
            //       single result in the "urp:convert-ppv2component" search, thus we only
            //       explicitly add one or the other here, instead of both.
            if (context.targetType == typeof(BIRPRendering.PostProcessVolume))
            {
                indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
            }
            else if (context.targetType == typeof(BIRPRendering.PostProcessLayer))
            {
                indexer.AddProperty("urp", "convert-ppv2component", context.documentIndex);
            }

            if (context.targetType == typeof(BIRPRendering.PostProcessProfile))
            {
                indexer.AddProperty("urp", "convert-ppv2scriptableobject", context.documentIndex);
            }
        }