コード例 #1
0
 public PrefabOverridesTreeView(GameObject selectedGameObject, TreeViewState state, PrefabOverridesWindow window) : base(state)
 {
     m_SelectedGameObject = selectedGameObject;
     m_Window             = window;
     rowHeight            = 18f;
     enableItemHovering   = true;
 }
コード例 #2
0
        public UnusedOverridesViewPopup(GameObject[] selectedGameObjects, PrefabOverridesWindow owner)
        {
            m_SelectedGameObjects = selectedGameObjects;
            m_Owner = owner;

            m_InstanceOverridesInfos = PrefabUtility.GetPrefabInstancesOverridesInfos(m_SelectedGameObjects);

            CalculateStatistics();

            float logHintWidth        = GetTextWidth(Styles.editorLogHint.text, Styles.bodyStyle);
            float headerWidth         = BuildHeaderText();
            float maxSummaryLineWidth = BuildMultilineSummary();

            float maxWidth = (headerWidth > logHintWidth) ? headerWidth : logHintWidth;

            if (maxSummaryLineWidth > maxWidth)
            {
                maxWidth = maxSummaryLineWidth;
            }

            m_ViewSize.x = maxWidth + k_ViewWidthPadding;

            var   lineHeight = GetTextHeight("a", Styles.bodyStyle);
            float height     = k_HeaderHeight + k_BodyTextPadding + (lineHeight * m_OverridesContent.Count) + (k_BodyTextPadding * 2) + k_BodyTextPaddingSmall;

            height      += (m_RemainingOverridesInfo != null) ? k_BodyTextPaddingSmall + EditorStyles.label.lineHeight : 0;
            m_ViewSize.y = height;
        }