当前位置: 首页>>代码示例>>C#>>正文


C# SerializedProperty.DuplicateCommand方法代码示例

本文整理汇总了C#中UnityEditor.SerializedProperty.DuplicateCommand方法的典型用法代码示例。如果您正苦于以下问题:C# SerializedProperty.DuplicateCommand方法的具体用法?C# SerializedProperty.DuplicateCommand怎么用?C# SerializedProperty.DuplicateCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEditor.SerializedProperty的用法示例。


在下文中一共展示了SerializedProperty.DuplicateCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoPropertyFieldKeyboardHandling

 private static void DoPropertyFieldKeyboardHandling(SerializedProperty property)
 {
   if (Event.current.type == EventType.ExecuteCommand || Event.current.type == EventType.ValidateCommand)
   {
     if (GUIUtility.keyboardControl == EditorGUIUtility.s_LastControlID && (Event.current.commandName == "Delete" || Event.current.commandName == "SoftDelete"))
     {
       if (Event.current.type == EventType.ExecuteCommand)
         EditorGUI.s_PendingPropertyDelete = property.Copy();
       Event.current.Use();
     }
     if (GUIUtility.keyboardControl == EditorGUIUtility.s_LastControlID && Event.current.commandName == "Duplicate")
     {
       if (Event.current.type == EventType.ExecuteCommand)
         property.DuplicateCommand();
       Event.current.Use();
     }
   }
   EditorGUI.s_PendingPropertyKeyboardHandling = (SerializedProperty) null;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:19,代码来源:EditorGUI.cs

示例2: SinglePropertyField


//.........这里部分代码省略.........
         }
         int controlID3 = GetControlID(s_GenericField, FocusType.Keyboard, position);
         EditorGUI.PrefixLabel(position, controlID3, label);
     IL_326: ;
     }
     else
     {
         int controlID4 = GetControlID(s_FoldoutHash, FocusType.Passive, position);
         EventType type = Event.current.type;
         if (type != EventType.DragUpdated && type != EventType.DragPerform)
         {
             if (type == EventType.DragExited)
             {
                 if (GUI.enabled)
                 {
                     HandleUtility.Repaint();
                 }
             }
         }
         else
         {
             if (position.Contains(Event.current.mousePosition) && GUI.enabled)
             {
                 Object[] objectReferences = DragAndDrop.objectReferences;
                 Object[] array = new Object[1];
                 bool flag2 = false;
                 Object[] array2 = objectReferences;
                 for (int i = 0; i < array2.Length; i++)
                 {
                     Object @object = array2[i];
                     array[0] = @object;
                     Object object2 = ValidateObjectFieldAssignment(array, null, property);
                     if (object2 != null)
                     {
                         DragAndDrop.visualMode = DragAndDropVisualMode.Copy;
                         if (Event.current.type == EventType.DragPerform)
                         {
                             property.AppendFoldoutPPtrValue(object2);
                             flag2 = true;
                             DragAndDrop.activeControlID = 0;
                         }
                         else
                         {
                             DragAndDrop.activeControlID = controlID4;
                         }
                     }
                 }
                 if (flag2)
                 {
                     GUI.changed = true;
                     DragAndDrop.AcceptDrag();
                     Event.current.Use();
                 }
             }
         }
         flag = property.isExpanded;
         if (lookLikeInspector)
         {
             int num = EditorStyles.foldout.padding.left - EditorStyles.label.padding.left;
             position.x -= (float)num;
             position.width += (float)num;
         }
         GUI.enabled &= property.editable;
         GUIStyle style = (DragAndDrop.activeControlID != -10) ? EditorStyles.foldout : EditorStyles.foldoutPreDrop;
         bool flag3 = EditorGUI.Foldout(position, flag, s_PropertyFieldTempContent, true, style);
         if (flag3 != flag)
         {
             if (Event.current.alt)
             {
                 SetExpandedRecurse(property, flag3);
             }
             else
             {
                 property.isExpanded = flag3;
             }
         }
         flag = flag3;
     }
     EditorGUI.EndProperty();
     if (Event.current.type == EventType.ExecuteCommand || Event.current.type == EventType.ValidateCommand)
     {
         if (GUIUtility.keyboardControl == lastControlID && (Event.current.commandName == "Delete" || Event.current.commandName == "SoftDelete"))
         {
             if (Event.current.type == EventType.ExecuteCommand)
             {
                 property.DeleteCommand();
             }
             Event.current.Use();
         }
         if (GUIUtility.keyboardControl == lastControlID && Event.current.commandName == "Duplicate")
         {
             if (Event.current.type == EventType.ExecuteCommand)
             {
                 property.DuplicateCommand();
             }
             Event.current.Use();
         }
     }
     return flag;
 }
开发者ID:QuantumCD,项目名称:unity-tooltips,代码行数:101,代码来源:TooltipDrawer.cs


注:本文中的UnityEditor.SerializedProperty.DuplicateCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。