protected override RichText GetDisplayText(OccurrencePresentationOptions options, RangeOccurrence rangeOccurrence) { var processor = rangeOccurrence.GetSolution().NotNull("rangeOccurrence.GetSolution() != null") .GetComponent <UnitySceneDataLocalCache>(); var occurrence = (rangeOccurrence as UnityEditorOccurrence).NotNull("rangeOccurrence as UnityEditorOccurrence != null"); var reference = (occurrence.PrimaryReference as IUnityYamlReference).NotNull("occurrence.PrimaryReference as IUnityYamlReference != null"); return(GetAttachedGameObjectName(processor, reference.ComponentDocument)); }
protected override RichText GetDisplayText(OccurrencePresentationOptions options, RangeOccurrence rangeOccurrence) { // false to show full scene path. Very expensive var unityPathSceneConsumer = new UnityPathSceneConsumer(true); var processor = rangeOccurrence.GetSolution().NotNull("rangeOccurrence.GetSolution() != null") .GetComponent <UnitySceneProcessor>(); var occurrence = (rangeOccurrence as UnityEditorOccurrence).NotNull("rangeOccurrence as UnityEditorOccurrence != null"); var reference = (occurrence.PrimaryReference as IUnityYamlReference).NotNull("occurrence.PrimaryReference as IUnityYamlReference != null"); processor.ProcessSceneHierarchyFromComponentToRoot(reference.ComponentDocument, unityPathSceneConsumer); return(unityPathSceneConsumer.NameParts.FirstOrDefault() ?? "Unknown"); }