public void DrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) { GetDrawerForMember(mightyMember, m_elementCallback, out var drawerMethod, baseAttribute); InvokeDrawer(drawerMethod, $"void {((CustomDrawerAttribute) baseAttribute).DrawerCallback}(Rect rect, SerializedProperty property, SerializedProperty element, int index)", rect, mightyMember.Property, mightyMember.GetElement(index), index); }
public override float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { var element = mightyMember.GetElement(index); if (element.propertyType != SerializedPropertyType.ObjectReference || element.objectReferenceValue == null) { return(50); } var previewTexture = AssetPreview.GetAssetPreview(element.objectReferenceValue); if (previewTexture == null) { return(50); } var showAssetAttribute = (ShowAssetPreviewAttribute)attribute; var textureRatio = (float)previewTexture.width / previewTexture.height; return((int)Mathf.Clamp(showAssetAttribute.Size / textureRatio, 0, previewTexture.height) + 15); }
public float GetElementHeight(BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) { var element = mightyMember.GetElement(index); return(element.propertyType != SerializedPropertyType.String ? 64 : Height(element) + 24); }
public void DrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawTextArea(rect, mightyMember.GetElement(index), (ResizableTextAreaAttribute)baseAttribute);
public void DrawElement(GUIContent label, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawTextArea(mightyMember.GetElement(index), (ResizableTextAreaAttribute)baseAttribute, label);
public void DrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawRotation2D(rect, mightyMember.GetElement(index), baseAttribute);
public void DrawElement(GUIContent label, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawRotation2D(mightyMember.GetElement(index), baseAttribute, label);
public void DrawElement(BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawMargins(mightyMember.GetElement(index), baseAttribute);
public float GetElementHeight(BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => mightyMember.GetElement(index).propertyType != SerializedPropertyType.Integer ? 64 : 20;
public void DrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawSlider(rect, mightyMember.GetElement(index), (MinMaxSliderAttribute)baseAttribute);
public void DrawElement(GUIContent label, BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawSlider(mightyMember.GetElement(index), (MinMaxSliderAttribute)baseAttribute, label);
public float GetElementHeight(BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) { var propertyType = mightyMember.GetElement(index).propertyType; return(propertyType != SerializedPropertyType.Integer && propertyType != SerializedPropertyType.Float ? 64 : 20); }
public void DrawElement(BaseMightyMember mightyMember, int index, BaseDrawerAttribute baseAttribute) => DrawSlider(mightyMember.GetElement(index), (PercentSliderAttribute)baseAttribute);
public override Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) => DrawPreview(rect, mightyMember.GetElement(index), (ShowAssetPreviewAttribute)attribute);