Пример #1
0
        public override Uri GetUrl(ICompiledElement element)
        {
            if (!element.GetSolution().HasUnityReference())
            {
                return(null);
            }
            if (!(element.Module is IAssemblyPsiModule module))
            {
                return(null);
            }
            var assemblyLocation = module.Assembly.Location;

            if (assemblyLocation == null || !assemblyLocation.ExistsFile)
            {
                return(null);
            }

            if (!(assemblyLocation.Name.StartsWith("UnityEngine") || assemblyLocation.Name.StartsWith("UnityEditor")))
            {
                return(null);
            }

            var searchableText = GetSearchableText(element);

            if (searchableText == null)
            {
                return(null);
            }

            return(myShowUnityHelp.GetUri(searchableText));
        }
        public Uri GetUrl(IDeclaredElement element)
        {
            if (!IsAvailable(element))
            {
                return(null);
            }
            var unityApi = element.GetSolution().GetComponent <UnityApi>();
            var keyword  = element.GetUnityEventFunctionName(unityApi);

            keyword = ShowUnityHelp.FormatDocumentationKeyword(keyword);
            if (keyword == null)
            {
                return(null);
            }
            return(myShowUnityHelp.GetUri(keyword));
        }