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


C# ReorderableList.onCanRemoveCallback方法代码示例

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


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

示例1: DrawFooter

			public void DrawFooter(Rect rect, ReorderableList list)
			{
				float xMax = rect.xMax;
				float num = xMax - 8f;
				if (list.displayAdd)
				{
					num -= 25f;
				}
				if (list.displayRemove)
				{
					num -= 25f;
				}
				rect = new Rect(num, rect.y, xMax - num, rect.height);
				Rect rect2 = new Rect(num + 4f, rect.y - 3f, 25f, 13f);
				Rect position = new Rect(xMax - 29f, rect.y - 3f, 25f, 13f);
				if (Event.current.type == EventType.Repaint)
				{
					this.footerBackground.Draw(rect, false, false, false, false);
				}
				if (list.displayAdd && GUI.Button(rect2, (list.onAddDropdownCallback == null) ? this.iconToolbarPlus : this.iconToolbarPlusMore, this.preButton))
				{
					if (list.onAddDropdownCallback != null)
					{
						list.onAddDropdownCallback(rect2, list);
					}
					else
					{
						if (list.onAddCallback != null)
						{
							list.onAddCallback(list);
						}
						else
						{
							this.DoAddButton(list);
						}
					}
					if (list.onChangedCallback != null)
					{
						list.onChangedCallback(list);
					}
				}
				if (list.displayRemove)
				{
					EditorGUI.BeginDisabledGroup(list.index < 0 || list.index >= list.count || (list.onCanRemoveCallback != null && !list.onCanRemoveCallback(list)));
					if (GUI.Button(position, this.iconToolbarMinus, this.preButton))
					{
						if (list.onRemoveCallback == null)
						{
							this.DoRemoveButton(list);
						}
						else
						{
							list.onRemoveCallback(list);
						}
						if (list.onChangedCallback != null)
						{
							list.onChangedCallback(list);
						}
					}
					EditorGUI.EndDisabledGroup();
				}
			}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:62,代码来源:ReorderableList.cs

示例2: DrawFooter

 public void DrawFooter(Rect rect, ReorderableList list)
 {
     float xMax = rect.xMax;
     float x = xMax - 8f;
     if (list.displayAdd)
     {
         x -= 25f;
     }
     if (list.displayRemove)
     {
         x -= 25f;
     }
     rect = new Rect(x, rect.y, xMax - x, rect.height);
     Rect position = new Rect(x + 4f, rect.y - 3f, 25f, 13f);
     Rect rect3 = new Rect(xMax - 29f, rect.y - 3f, 25f, 13f);
     if (Event.current.type == EventType.Repaint)
     {
         this.footerBackground.Draw(rect, false, false, false, false);
     }
     if (list.displayAdd && GUI.Button(position, (list.onAddDropdownCallback == null) ? this.iconToolbarPlus : this.iconToolbarPlusMore, this.preButton))
     {
         if (list.onAddDropdownCallback != null)
         {
             list.onAddDropdownCallback(position, list);
         }
         else if (list.onAddCallback != null)
         {
             list.onAddCallback(list);
         }
         else
         {
             this.DoAddButton(list);
         }
         if (list.onChangedCallback != null)
         {
             list.onChangedCallback(list);
         }
     }
     if (list.displayRemove)
     {
         using (new EditorGUI.DisabledScope(((list.index < 0) || (list.index >= list.count)) || ((list.onCanRemoveCallback != null) && !list.onCanRemoveCallback(list))))
         {
             if (GUI.Button(rect3, this.iconToolbarMinus, this.preButton))
             {
                 if (list.onRemoveCallback == null)
                 {
                     this.DoRemoveButton(list);
                 }
                 else
                 {
                     list.onRemoveCallback(list);
                 }
                 if (list.onChangedCallback != null)
                 {
                     list.onChangedCallback(list);
                 }
             }
         }
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:60,代码来源:ReorderableList.cs


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