예제 #1
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();
     }
 }
예제 #2
0
 public SerializedPropertyItem(int id, int depth, SerializedPropertyDataStore.Data ltd) : base(id, depth, (ltd == null) ? "root" : ltd.name)
 {
     this.m_Data = ltd;
 }
예제 #3
0
 public SerializedPropertyItem(int id, int depth, SerializedPropertyDataStore.Data ltd) : base(id, depth, ltd != null ? ltd.name : "root")
 {
     m_Data = ltd;
 }