Esempio n. 1
0
        /// <inheritdoc/>
        protected override void DoGenerateMemberBuildList()
        {
                        #if DEV_MODE
            Debug.Log(ToString() + ".DoGenerateMemberBuildList");
                        #endif

            base.DoGenerateMemberBuildList();

                        #if DEV_MODE && PI_ASSERTATIONS
            Debug.Assert(Views.Length > 0);
            Debug.Assert(sideBarItemHeight > 0f);
            Debug.Assert(inspector.ToolbarHeight > 0f);
                        #endif

            height = Views.Length * sideBarItemHeight + inspector.ToolbarHeight + HeaderHeight - 4f;

                        #if DEV_MODE && PI_ASSERTATIONS
            Debug.Assert(ExpectedViewCount == Views.Length, "ExpectedViewCount " + ExpectedViewCount + " != Views.Length " + Views.Length);
            Debug.Assert(ExpectedSideBarItemHeight == sideBarItemHeight);
            Debug.Assert(ExpectedHeaderHeight == HeaderHeight, "ExpectedHeaderHeight " + ExpectedHeaderHeight + " != " + HeaderHeight);
            Debug.Assert(ExpectedToolbarHeight == inspector.ToolbarHeight, "ExpectedToolbarHeight " + ExpectedToolbarHeight + " != " + inspector.ToolbarHeight);
            Debug.Assert(GetExpectedHeight() == height, "GetExpectedHeight() " + GetExpectedHeight() + " != " + height);
            Debug.Assert(GetExpectedHeight(inspector.ToolbarHeight) == height, "GetExpectedHeight(ToolbarHeight) " + GetExpectedHeight(inspector.ToolbarHeight) + " != " + height);
                        #endif

            UpdateMinMaxSize();

            PowerInspectorDocumentation.ShowPreferencesIfWindowOpen("", OnFailToLoadDocumentationPage);
        }
Esempio n. 2
0
        private void OnFailToLoadDocumentationPage([NotNull] string failedToLoadUrl)
        {
                        #if DEV_MODE
            Debug.LogWarning("Failed to load documentation page: " + failedToLoadUrl);
                        #endif

            if (!string.IsNullOrEmpty(failedToLoadUrl))
            {
                PowerInspectorDocumentation.ShowPreferencesIfWindowOpen("");
            }
        }
Esempio n. 3
0
        private void ShowDocumentationForMember([NotNull] IDrawer member)
        {
            if (member == this)
            {
                PowerInspectorDocumentation.ShowPreferencesIfWindowOpen("", OnFailToLoadDocumentationPage);
                OnAutoDocumentationUpdated(PowerInspectorDocumentation.PreferencesUrl);
                return;
            }

            var parent = member.Parent;

            if (parent != this && member != this && parent != null)
            {
                switch (parent.Name)
                {
                // Usually we want to get the documentation page for the member that is at the root of the preferences drawer.
                default:
                    for (; member.Parent != this && member.Parent != null; member = member.Parent)
                    {
                        ;
                    }
                    break;

                // Sometimes we have specific documentation pages for nested members too.
                case "Mouseover Effects":
                case "Default Inspector":
                case "Create Script Wizard":
                    break;
                }
            }

            var memberInfo = member.MemberInfo;

            if (memberInfo != null)
            {
                var name = memberInfo.DisplayName;
                var url  = GetDocumentationPageUrl(name);

                                #if DEV_MODE
                Debug.Log("Showing preferences documentation: " + url);
                                #endif

                PowerInspectorDocumentation.ShowPreferencesIfWindowOpen(url, OnFailToLoadDocumentationPage);
                OnAutoDocumentationUpdated(url);
            }
        }