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


C# SerializedProperty.GetEndProperty方法代码示例

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


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

示例1: GetHeight

		public float GetHeight(SerializedProperty property, GUIContent label, bool includeChildren)
		{
			float num = 0f;
			if (this.m_DecoratorDrawers != null)
			{
				foreach (DecoratorDrawer current in this.m_DecoratorDrawers)
				{
					num += current.GetHeight();
				}
			}
			if (this.propertyDrawer != null)
			{
				num += this.propertyDrawer.GetPropertyHeightSafe(property.Copy(), label ?? EditorGUIUtility.TempContent(property.displayName));
			}
			else
			{
				if (!includeChildren)
				{
					num += EditorGUI.GetSinglePropertyHeight(property, label);
				}
				else
				{
					property = property.Copy();
					SerializedProperty endProperty = property.GetEndProperty();
					num += EditorGUI.GetSinglePropertyHeight(property, label);
					bool enterChildren = property.isExpanded && EditorGUI.HasVisibleChildFields(property);
					while (property.NextVisible(enterChildren) && !SerializedProperty.EqualContents(property, endProperty))
					{
						num += ScriptAttributeUtility.GetHandler(property).GetHeight(property, EditorGUIUtility.TempContent(property.displayName), true);
						enterChildren = false;
						num += 2f;
					}
				}
			}
			return num;
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:36,代码来源:PropertyHandler.cs

示例2: DrawControl

        public override object DrawControl(Rect position, SerializedProperty property, GUIContent label, object value)
        {
            var attr = (GroupAttribute)attribute;

            if (fieldInfo.FieldType.IsClass &&
                !typeof(Object).IsAssignableFrom(fieldInfo.FieldType) &&
                !typeof(IList).IsAssignableFrom(fieldInfo.FieldType)) {

                if (attr.drawFoldout) {
                    EditorGUI.PropertyField(position, property, label, true);
                } else {
                    property.isExpanded = true;

                    SerializedProperty endProperty = property.GetEndProperty();
                    property.NextVisible(true);

                    while (!SerializedProperty.EqualContents(property, endProperty)) {
                        position.height = EditorGUI.GetPropertyHeight(property);
                        EditorGUI.PropertyField(position, property, true);
                        position.y += position.height + EditorGUIUtility.standardVerticalSpacing;
                        property.NextVisible(false);
                    }
                }

                return value;
            } else {
                throw new InvalidCastException(String.Format(
                    "Field '{0}' of type '{1}' must be a class not derived from UnityEngine.Object to be used with the Inspector.Group attribute.",
                    fieldInfo.Name, fieldInfo.FieldType));
            }
        }
开发者ID:B-LiTE,项目名称:MemeTeam,代码行数:31,代码来源:InspectorAttributesEditor.cs

示例3: GetPropertyHeight

 public static float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     //PropertyDrawer drawer = PropertyDrawer.GetDrawer(property);
     //if (drawer != null)
     //{
     //    return drawer.GetPropertyHeight(property.Copy(), label ?? EditorGUIUtility.TempContent(property.displayName));
     //}
     property = property.Copy();
     SerializedProperty endProperty = property.GetEndProperty();
     float height = EditorGUIEx.GetSinglePropertyHeight(property, label);
     bool enterChildren = property.isExpanded && EditorGUIEx.HasVisibleChildFields(property);
     while (property.NextVisible(enterChildren) && !SerializedProperty.EqualContents(property, endProperty))
     {
         //drawer = PropertyDrawer.GetDrawer(property);
         //if (drawer != null)
         //{
         //    height += drawer.GetPropertyHeight(property.Copy(), EditorGUIUtility.TempContent(property.displayName));
         //    enterChildren = false;
         //}
         //else
         {
             height += EditorGUIEx.GetSinglePropertyHeight(property);
             enterChildren = (property.isExpanded && EditorGUIEx.HasVisibleChildFields(property));
         }
     }
     return height;
 }
开发者ID:QuantumCD,项目名称:unity-tooltips,代码行数:27,代码来源:TooltipDrawer.cs

示例4: DrawSerializedProperty

		private bool DrawSerializedProperty (SerializedProperty _property)
		{
			if (_property == null)
				return false;

			// Draw header
			bool	_isSelected		= UnityEditorUtility.DrawPropertyHeader(_property);

			// Draw immediate childrens
			if (_property.hasVisibleChildren && _property.isExpanded)
			{
				SerializedProperty	_propertyCopy	= _property.Copy();
				SerializedProperty 	_endProperty	= _property.GetEndProperty();

				// Move to immediate child property
				_propertyCopy.NextVisible(true);
				
				GUILayout.Space(-4f);
				GUILayout.BeginHorizontal("HelpBox");
				{
					GUILayout.Space(8f);
					GUILayout.BeginVertical();
					{
						do
						{
							if (SerializedProperty.EqualContents(_propertyCopy, _endProperty))
								break;

							// Lets make all properties expanded
							_propertyCopy.isExpanded	= true;
							
							EditorGUILayout.PropertyField(_propertyCopy, true);
						}while (_propertyCopy.NextVisible(false));
					}
					GUILayout.EndVertical();
				}
				GUILayout.EndHorizontal();
			}

			return _isSelected;
		}
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:41,代码来源:NPSettingsInspector.cs

示例5: GetHeight

 public float GetHeight(SerializedProperty property, GUIContent label, bool includeChildren)
 {
   float num1 = 0.0f;
   if (this.m_DecoratorDrawers != null && !this.isCurrentlyNested)
   {
     using (List<DecoratorDrawer>.Enumerator enumerator = this.m_DecoratorDrawers.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         DecoratorDrawer current = enumerator.Current;
         num1 += current.GetHeight();
       }
     }
   }
   float num2;
   if (this.propertyDrawer != null)
     num2 = num1 + this.propertyDrawer.GetPropertyHeightSafe(property.Copy(), label ?? EditorGUIUtility.TempContent(property.displayName));
   else if (!includeChildren)
   {
     num2 = num1 + EditorGUI.GetSinglePropertyHeight(property, label);
   }
   else
   {
     property = property.Copy();
     SerializedProperty endProperty = property.GetEndProperty();
     num2 = num1 + EditorGUI.GetSinglePropertyHeight(property, label);
     bool enterChildren = property.isExpanded && EditorGUI.HasVisibleChildFields(property);
     while (property.NextVisible(enterChildren) && !SerializedProperty.EqualContents(property, endProperty))
     {
       float num3 = num2 + ScriptAttributeUtility.GetHandler(property).GetHeight(property, EditorGUIUtility.TempContent(property.displayName), true);
       enterChildren = false;
       num2 = num3 + 2f;
     }
   }
   return num2;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:36,代码来源:PropertyHandler.cs


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