Ejemplo n.º 1
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            Rect            rowSpace       = args.rowRect;
            EZMTreeViewItem entityTreeItem = args.item as EZMTreeViewItem;
            var             childOptions   = entityTreeItem.GetChildOptions();

            if (childOptions != null)
            {
                if (GUI.Button(rowSpace.WithSize(new Vector2(17.5f, 17.5f)).WithX(rowSpace.xMax - 20), "+", EditorStyles.centeredGreyMiniLabel))
                {
                    GenericMenu gm = new GenericMenu();

                    for (int i = 0; i < childOptions.Length; i++)
                    {
                        var type = childOptions[i];
                        gm.AddItem(new GUIContent("Add " + childOptions[i].Name), false, () =>
                        {
                            AddElement(entityTreeItem, type);
                            Reload();
                        });
                    }

                    gm.ShowAsContext();
                }
            }

            base.RowGUI(args);
        }
Ejemplo n.º 2
0
 protected override void RowGUI(TreeView.RowGUIArgs args)
 {
     SerializedPropertyTreeView.SerializedPropertyItem item = (SerializedPropertyTreeView.SerializedPropertyItem)args.item;
     for (int i = 0; i < args.GetNumVisibleColumns(); i++)
     {
         this.CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
     }
 }
            protected override void RowGUI(TreeView.RowGUIArgs args)
            {
                TreeViewItem item = args.item;

                for (int i = 0; i < args.GetNumVisibleColumns(); i++)
                {
                    this.CellGUI(args.GetCellRect(i), item, (ProfilerDetailedCallsView.CallsTreeView.Column)args.GetColumn(i), ref args);
                }
            }
Ejemplo n.º 4
0
 protected override void RowGUI(TreeView.RowGUIArgs args)
 {
     if (Event.current.rawType == EventType.Repaint)
     {
         for (int i = 0; i < args.GetNumVisibleColumns(); i++)
         {
             this.CellGUI(args.GetCellRect(i), args.item, (ProfilerDetailedCallsView.CallsTreeView.Column)args.GetColumn(i), ref args);
         }
     }
 }
Ejemplo n.º 5
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem = args.item as BuildPlayerSceneTreeViewItem;

            if (buildPlayerSceneTreeViewItem != null)
            {
                bool flag = !buildPlayerSceneTreeViewItem.guid.Empty() && File.Exists(buildPlayerSceneTreeViewItem.fullName);
                using (new EditorGUI.DisabledScope(!flag))
                {
                    bool flag2 = buildPlayerSceneTreeViewItem.active;
                    if (!flag)
                    {
                        flag2 = false;
                    }
                    flag2 = GUI.Toggle(new Rect(args.rowRect.x, args.rowRect.y, 16f, 16f), flag2, "");
                    if (flag2 != buildPlayerSceneTreeViewItem.active)
                    {
                        if (base.GetSelection().Contains(buildPlayerSceneTreeViewItem.id))
                        {
                            IList <int> selection = base.GetSelection();
                            foreach (int current in selection)
                            {
                                BuildPlayerSceneTreeViewItem buildPlayerSceneTreeViewItem2 = base.FindItem(current, base.rootItem) as BuildPlayerSceneTreeViewItem;
                                buildPlayerSceneTreeViewItem2.active = flag2;
                            }
                        }
                        else
                        {
                            buildPlayerSceneTreeViewItem.active = flag2;
                        }
                        EditorBuildSettings.scenes = this.GetSceneList();
                    }
                    base.RowGUI(args);
                    if (buildPlayerSceneTreeViewItem.counter != BuildPlayerSceneTreeViewItem.kInvalidCounter)
                    {
                        TreeView.DefaultGUI.LabelRightAligned(args.rowRect, "" + buildPlayerSceneTreeViewItem.counter, args.selected, args.focused);
                    }
                    else if (buildPlayerSceneTreeViewItem.displayName == string.Empty || !flag)
                    {
                        TreeView.DefaultGUI.LabelRightAligned(args.rowRect, "Deleted", args.selected, args.focused);
                    }
                }
            }
            else
            {
                base.RowGUI(args);
            }
        }
 protected override void RowGUI(TreeView.RowGUIArgs args)
 {
     if (Event.current.rawType == EventType.Repaint)
     {
         if (this.m_ObjectsData == null || this.m_ObjectsData.Count == 0)
         {
             base.RowGUI(args);
         }
         else
         {
             TreeViewItem item = args.item;
             for (int i = 0; i < args.GetNumVisibleColumns(); i++)
             {
                 this.CellGUI(args.GetCellRect(i), item, args.GetColumn(i), ref args);
             }
         }
     }
 }
Ejemplo n.º 7
0
 protected override void RowGUI(TreeView.RowGUIArgs args)
 {
     if (Event.current.type == EventType.Repaint)
     {
         int i = 0;
         int numVisibleColumns = args.GetNumVisibleColumns();
         while (i < numVisibleColumns)
         {
             int  column   = args.GetColumn(i);
             Rect cellRect = args.GetCellRect(i);
             if (column == 0)
             {
                 GUIStyle label = TreeView.DefaultStyles.label;
                 cellRect.xMin += (float)label.margin.left + base.GetContentIndent(args.item);
                 int  num      = 16;
                 int  num2     = 2;
                 Rect position = cellRect;
                 position.width = (float)num;
                 Texture icon = args.item.icon;
                 if (icon != null)
                 {
                     GUI.DrawTexture(position, icon, ScaleMode.ScaleToFit);
                 }
                 label.padding.left = ((!(icon == null)) ? (num + num2) : 0);
                 label.Draw(cellRect, args.item.displayName, false, false, args.selected, args.focused);
             }
             else
             {
                 string itemcontent = this.GetItemcontent(args, column);
                 if (itemcontent != null)
                 {
                     TreeView.DefaultGUI.LabelRightAligned(cellRect, itemcontent, args.selected, args.focused);
                 }
                 else
                 {
                     GUI.enabled = false;
                     TreeView.DefaultGUI.LabelRightAligned(cellRect, "-", false, false);
                     GUI.enabled = true;
                 }
             }
             i++;
         }
     }
 }
Ejemplo n.º 8
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            IDialogueItem item = this.dialogueEditor.InstanceIDToObject(args.item.id);

            Rect altRect = new Rect(
                args.rowRect.x,
                args.rowRect.y,
                args.rowRect.width - ROW_ICON_WIDTH,
                args.rowRect.height
                );

            Rect iconRect = new Rect(
                args.rowRect.x + args.rowRect.width - ROW_ICON_WIDTH,
                args.rowRect.y,
                ROW_ICON_WIDTH,
                EditorGUIUtility.singleLineHeight
                );

            if (item != null)
            {
                switch (item.afterRun)
                {
                case IDialogueItem.AfterRunBehaviour.Exit:
                    args.rowRect = altRect;
                    base.RowGUI(args);
                    EditorGUI.LabelField(iconRect, GetIconExit());
                    break;

                case IDialogueItem.AfterRunBehaviour.Jump:
                    args.rowRect = altRect;
                    base.RowGUI(args);
                    EditorGUI.LabelField(iconRect, GetIconJump());
                    break;

                default:
                    base.RowGUI(args);
                    break;
                }
            }
        }
Ejemplo n.º 9
0
 protected override void RowGUI(TreeView.RowGUIArgs args)
 {
     if (Event.current.rawType == EventType.Repaint)
     {
         ProfilerFrameDataTreeView.FrameDataTreeViewItem frameDataTreeViewItem = (ProfilerFrameDataTreeView.FrameDataTreeViewItem)args.item;
         frameDataTreeViewItem.Init(this.m_MultiColumnHeader.columns);
         for (int i = 0; i < args.GetNumVisibleColumns(); i++)
         {
             Rect cellRect = args.GetCellRect(i);
             this.CellGUI(cellRect, frameDataTreeViewItem, i == 0, args.GetColumn(i), ref args);
         }
         if (args.selected)
         {
             if (args.rowRect.Contains(Event.current.mousePosition))
             {
                 if (base.hasSearch)
                 {
                     GUIStyle.SetMouseTooltip(ProfilerFrameDataTreeView.kFrameTooltip.tooltip, args.rowRect);
                 }
             }
         }
     }
 }
            private void CellGUI(Rect cellRect, TreeViewItem item, ProfilerDetailedCallsView.CallsTreeView.Column column, ref TreeView.RowGUIArgs args)
            {
                if (this.m_CallsData.calls.Count == 0)
                {
                    base.RowGUI(args);
                }
                else
                {
                    ProfilerDetailedCallsView.CallInformation callInformation = this.m_CallsData.calls[args.item.id - 1];
                    base.CenterRectUsingSingleLineHeight(ref cellRect);
                    switch (column)
                    {
                    case ProfilerDetailedCallsView.CallsTreeView.Column.Name:
                        TreeView.DefaultGUI.Label(cellRect, callInformation.name, args.selected, args.focused);
                        break;

                    case ProfilerDetailedCallsView.CallsTreeView.Column.Calls:
                    {
                        string label = callInformation.callsCount.ToString();
                        TreeView.DefaultGUI.LabelRightAligned(cellRect, label, args.selected, args.focused);
                        break;
                    }

                    case ProfilerDetailedCallsView.CallsTreeView.Column.GcAlloc:
                    {
                        int gcAllocBytes = callInformation.gcAllocBytes;
                        TreeView.DefaultGUI.LabelRightAligned(cellRect, gcAllocBytes.ToString(), args.selected, args.focused);
                        break;
                    }

                    case ProfilerDetailedCallsView.CallsTreeView.Column.TimeMs:
                    {
                        double num = (this.m_Type != ProfilerDetailedCallsView.CallsTreeView.Type.Callees) ? callInformation.totalSelfTimeMs : callInformation.totalCallTimeMs;
                        TreeView.DefaultGUI.LabelRightAligned(cellRect, num.ToString("f2"), args.selected, args.focused);
                        break;
                    }

                    case ProfilerDetailedCallsView.CallsTreeView.Column.TimePercent:
                        TreeView.DefaultGUI.LabelRightAligned(cellRect, (callInformation.timePercent * 100.0).ToString("f2"), args.selected, args.focused);
                        break;
                    }
                }
            }
Ejemplo n.º 11
0
 private void CellGUI(Rect cellRect, SerializedPropertyTreeView.SerializedPropertyItem item, int columnIndex, ref TreeView.RowGUIArgs args)
 {
     Profiler.BeginSample("SerializedPropertyTreeView.CellGUI");
     base.CenterRectUsingSingleLineHeight(ref cellRect);
     SerializedPropertyDataStore.Data  data   = item.GetData();
     SerializedPropertyTreeView.Column column = (SerializedPropertyTreeView.Column)base.multiColumnHeader.GetColumn(columnIndex);
     if (column.drawDelegate == SerializedPropertyTreeView.DefaultDelegates.s_DrawName)
     {
         Profiler.BeginSample("SerializedPropertyTreeView.OnItemGUI.LabelField");
         TreeView.DefaultGUI.Label(cellRect, data.name, base.IsSelected(args.item.id), false);
         Profiler.EndSample();
     }
     else if (column.drawDelegate != null)
     {
         SerializedProperty[] properties = data.properties;
         int num = (column.dependencyIndices == null) ? 0 : column.dependencyIndices.Length;
         for (int i = 0; i < num; i++)
         {
             this.m_ColumnsInternal[columnIndex].dependencyProps[i] = properties[column.dependencyIndices[i]];
         }
         if (args.item.id == base.state.lastClickedID && base.HasFocus() && columnIndex == base.multiColumnHeader.state.visibleColumns[(base.multiColumnHeader.state.visibleColumns[0] != 0) ? 0 : 1])
         {
             GUI.SetNextControlName(SerializedPropertyTreeView.Styles.focusHelper);
         }
         SerializedProperty serializedProperty = data.properties[columnIndex];
         EditorGUI.BeginChangeCheck();
         Profiler.BeginSample("SerializedPropertyTreeView.OnItemGUI.drawDelegate");
         column.drawDelegate(cellRect, serializedProperty, this.m_ColumnsInternal[columnIndex].dependencyProps);
         Profiler.EndSample();
         if (EditorGUI.EndChangeCheck())
         {
             this.m_ChangedId = ((column.filter == null || !column.filter.Active()) ? this.m_ChangedId : GUIUtility.keyboardControl);
             data.Store();
             IList <int> selection = base.GetSelection();
             if (selection.Contains(data.objectId))
             {
                 IList <TreeViewItem> list = base.FindRows(selection);
                 Undo.RecordObjects((from r in list
                                     select((SerializedPropertyTreeView.SerializedPropertyItem)r).GetData().serializedObject.targetObject).ToArray <UnityEngine.Object>(), "Modify Multiple Properties");
                 foreach (TreeViewItem current in list)
                 {
                     if (current.id != args.item.id)
                     {
                         SerializedPropertyDataStore.Data data2 = ((SerializedPropertyTreeView.SerializedPropertyItem)current).GetData();
                         if (SerializedPropertyTreeView.IsEditable(data2.serializedObject.targetObject))
                         {
                             if (column.copyDelegate != null)
                             {
                                 column.copyDelegate(data2.properties[columnIndex], serializedProperty);
                             }
                             else
                             {
                                 SerializedPropertyTreeView.DefaultDelegates.s_CopyDefault(data2.properties[columnIndex], serializedProperty);
                             }
                             data2.Store();
                         }
                     }
                 }
             }
         }
         Profiler.EndSample();
     }
 }
 private void CellGUI(Rect cellRect, TreeViewItem item, int column, ref TreeView.RowGUIArgs args)
 {
     ProfilerDetailedObjectsView.ObjectInformation objectInformation = this.m_ObjectsData[args.item.id];
     base.CenterRectUsingSingleLineHeight(ref cellRect);
     TreeView.DefaultGUI.Label(cellRect, objectInformation.columnStrings[column], args.selected, args.focused);
 }
Ejemplo n.º 13
0
        private string GetItemcontent(TreeView.RowGUIArgs args, int column)
        {
            string result;

            if (this.m_AllCanvasesItem != null && args.item.id == this.m_AllCanvasesItem.id)
            {
                switch (column)
                {
                case 2:
                    result = this.m_AllCanvasesItem.totalBatchCount.ToString();
                    return(result);

                case 4:
                    result = this.m_AllCanvasesItem.totalVertexCount.ToString();
                    return(result);

                case 6:
                    result = this.m_AllCanvasesItem.gameObjectCount.ToString();
                    return(result);
                }
                result = null;
            }
            else
            {
                UISystemProfilerTreeView.BatchTreeViewItem batchTreeViewItem = args.item as UISystemProfilerTreeView.BatchTreeViewItem;
                if (batchTreeViewItem != null)
                {
                    UISystemProfilerInfo info = batchTreeViewItem.info;
                    switch (column)
                    {
                    case 0:
                    case 1:
                    case 2:
                        break;

                    case 3:
                        result = info.vertexCount.ToString();
                        return(result);

                    case 4:
                        result = info.totalVertexCount.ToString();
                        return(result);

                    case 5:
                        if (info.batchBreakingReason != BatchBreakingReason.NoBreaking)
                        {
                            result = UISystemProfilerTreeView.FormatBatchBreakingReason(info);
                            return(result);
                        }
                        break;

                    case 6:
                        result = info.instanceIDsCount.ToString();
                        return(result);

                    case 7:
                        if (batchTreeViewItem.instanceIDs.Length <= 5)
                        {
                            StringBuilder stringBuilder = new StringBuilder();
                            for (int i = 0; i < batchTreeViewItem.instanceIDs.Length; i++)
                            {
                                if (i != 0)
                                {
                                    stringBuilder.Append(", ");
                                }
                                int num = batchTreeViewItem.instanceIDs[i];
                                UnityEngine.Object @object = EditorUtility.InstanceIDToObject(num);
                                if (@object == null)
                                {
                                    stringBuilder.Append(num);
                                }
                                else
                                {
                                    stringBuilder.Append(@object.name);
                                }
                            }
                            result = stringBuilder.ToString();
                            return(result);
                        }
                        result = string.Format("{0} objects", batchTreeViewItem.instanceIDs.Length);
                        return(result);

                    case 8:
                        result = info.renderDataIndex.ToString();
                        return(result);

                    default:
                        result = "Missing";
                        return(result);
                    }
                    result = null;
                }
                else
                {
                    UISystemProfilerTreeView.CanvasTreeViewItem canvasTreeViewItem = args.item as UISystemProfilerTreeView.CanvasTreeViewItem;
                    if (canvasTreeViewItem != null)
                    {
                        UISystemProfilerInfo info2 = canvasTreeViewItem.info;
                        switch (column)
                        {
                        case 0:
                        case 3:
                        case 5:
                        case 7:
                            result = null;
                            break;

                        case 1:
                            result = info2.batchCount.ToString();
                            break;

                        case 2:
                            result = info2.totalBatchCount.ToString();
                            break;

                        case 4:
                            result = info2.totalVertexCount.ToString();
                            break;

                        case 6:
                            result = info2.instanceIDsCount.ToString();
                            break;

                        case 8:
                            result = info2.renderDataIndex + " : " + info2.renderDataCount;
                            break;

                        default:
                            result = "Missing";
                            break;
                        }
                    }
                    else
                    {
                        result = null;
                    }
                }
            }
            return(result);
        }
Ejemplo n.º 14
0
        private void CellGUI(Rect cellRect, ProfilerFrameDataTreeView.FrameDataTreeViewItem item, bool needsIndent, int column, ref TreeView.RowGUIArgs args)
        {
            if (needsIndent)
            {
                float num = base.GetContentIndent(item) + base.extraSpaceBeforeIconAndLabel;
                cellRect.xMin += num;
            }
            base.CenterRectUsingSingleLineHeight(ref cellRect);
            GUIContent content = GUIContent.Temp(item.columnStrings[column], string.Empty);

            TreeView.DefaultStyles.label.Draw(cellRect, content, false, false, args.selected, args.focused);
        }
Ejemplo n.º 15
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            base.RowGUI(args);
            if (args.isRenaming)
            {
                return;
            }

            if (this.CanRename(args.item) && args.selected)
            {
                if (Event.current.type == EventType.ContextClick)
                {
                    this.BeginRename(args.item);
                    Event.current.Use();
                    return;
                }
            }

            Rect rectActionsFail = new Rect(
                args.rowRect.x + args.rowRect.width - ICON_INFO_WIDTH,
                args.rowRect.y,
                ICON_INFO_WIDTH,
                args.rowRect.height
                );

            Rect rectActionsComplete = new Rect(
                rectActionsFail.x - ICON_INFO_WIDTH,
                args.rowRect.y,
                ICON_INFO_WIDTH,
                args.rowRect.height
                );

            Rect rectConditions = new Rect(
                rectActionsComplete.x - ICON_INFO_WIDTH,
                args.rowRect.y,
                SETTINGS_BTN_WIDTH,
                args.rowRect.height
                );

            if (!this.databaseQuestsEditor.questsEditors.ContainsKey(args.item.id))
            {
                return;
            }
            IQuestEditor iquestEditor = this.databaseQuestsEditor.questsEditors[args.item.id];

            QuestReaction reaction = iquestEditor.iquest.reactions;

            if (reaction == null)
            {
                return;
            }

            GUIContent contentFail = QuestTreeUtils.GetIcon((
                                                                reaction.onFail != null && reaction.onFail.actions.Length > 0
                ? QuestTreeUtils.Icon.OnFail
                : QuestTreeUtils.Icon.OffFail
                                                                ));

            GUIContent contentComplete = QuestTreeUtils.GetIcon((
                                                                    reaction.onComplete != null && reaction.onComplete.actions.Length > 0
                                ? QuestTreeUtils.Icon.OnComplete
                                : QuestTreeUtils.Icon.OffComplete
                                                                    ));

            GUIContent contentConditions = QuestTreeUtils.GetIcon((
                                                                      reaction.conditions != null && reaction.conditions.conditions.Length > 0
                                ? QuestTreeUtils.Icon.OnConditions
                                : QuestTreeUtils.Icon.OffConditions
                                                                      ));

            EditorGUI.LabelField(rectActionsFail, contentFail);
            EditorGUI.LabelField(rectActionsComplete, contentComplete);
            EditorGUI.LabelField(rectConditions, contentConditions);

            if (EditorApplication.isPlaying)
            {
                args.item.icon = iquestEditor.GetIcon();
            }

            Rect rectSettings = new Rect(
                rectConditions.x - SETTINGS_BTN_WIDTH - 5f,
                args.rowRect.y,
                SETTINGS_BTN_WIDTH,
                args.rowRect.height
                );

            if (!EditorApplication.isPlaying && this.IsSelected(args.item.id))
            {
                if (GUI.Button(rectSettings, GUICONTENT_EDIT, EditorStyles.miniButton))
                {
                    QuestConfigWindow.Open(iquestEditor);
                }
            }
            else if (iquestEditor.ShowProgress())
            {
                float progress = iquestEditor.GetProgress();
                Rect  rectBkg  = new Rect(
                    rectSettings.x + PROG_PADDING,
                    rectSettings.y + (rectSettings.height / 2.0f - PROG_HEIGHT / 2.0f),
                    rectSettings.width - (2f * PROG_PADDING),
                    PROG_HEIGHT
                    );
                Rect rectBar = new Rect(
                    rectBkg.x,
                    rectBkg.y,
                    rectBkg.width * progress,
                    rectBkg.height
                    );

                EditorGUI.DrawRect(rectBkg, EditorApplication.isPlaying ? PROG_BCK_R : PROG_BCK_E);
                EditorGUI.DrawRect(rectBar, EditorApplication.isPlaying ? PROG_BAR_R : PROG_BAR_E);
            }
        }
Ejemplo n.º 16
0
        protected override void RowGUI(TreeView.RowGUIArgs args)
        {
            IDialogueItem item = this.dialogueEditor.InstanceIDToObject(args.item.id);

            Rect altRect = new Rect(
                args.rowRect.x,
                args.rowRect.y,
                args.rowRect.width - (EditorGUIUtility.singleLineHeight * 3f),
                args.rowRect.height
                );

            Rect icon1Rect = new Rect(
                args.rowRect.x + args.rowRect.width - EditorGUIUtility.singleLineHeight,
                args.rowRect.y,
                EditorGUIUtility.singleLineHeight,
                EditorGUIUtility.singleLineHeight
                );

            Rect icon2Rect = new Rect(
                icon1Rect.x - icon1Rect.width,
                icon1Rect.y,
                icon1Rect.width,
                icon1Rect.height
                );

            Rect icon3Rect = new Rect(
                icon2Rect.x - icon2Rect.width,
                icon2Rect.y,
                icon2Rect.width,
                icon2Rect.height
                );

            if (item != null)
            {
                args.rowRect = altRect;
                base.RowGUI(args);

                switch (item.afterRun)
                {
                case IDialogueItem.AfterRunBehaviour.Exit:
                    GUI.DrawTexture(icon1Rect, GetIconExit());
                    break;

                case IDialogueItem.AfterRunBehaviour.Jump:
                    GUI.DrawTexture(icon1Rect, GetIconJump());
                    break;
                }

                Texture actions = (item.actionsList.actions.Length > 0
                    ? GetIconActions()
                    : GetIconNoActions()
                                   );

                GUI.DrawTexture(icon3Rect, actions);

                Texture conditions = (item.conditionsList.conditions.Length > 0
                    ? GetIconConditions()
                    : GetIconNoConditions()
                                      );

                GUI.DrawTexture(icon2Rect, conditions);
            }
        }