/// <summary> /// <para>Default constructor for <see cref="AssetIconsStyle"/>.</para> /// </summary> /// <remarks> /// <para>The default values from this constructor are the same as the default values of the <see cref="AssetIconAttribute"/> constructor.</para> /// </remarks> public AssetIconsStyle() { Width = "100%"; Height = "100%"; X = "0"; Y = "0"; MaxSize = int.MaxValue; Anchor = IconAnchor.Center; Aspect = IconAspect.Fit; Display = "true"; Tint = IconColor.White; Layer = 0; FontStyle = FontStyle.Normal; TextAnchor = IconAnchor.Center; Projection = IconProjection.Perspective; }
/// <summary> /// <para>Marks a field to be used as a graphic for a custom icon.</para> /// </summary> /// <param name="width">An expression that's evaluated to determine the width of the icon.</param> /// <param name="height">An expression that's evaluated to determine the height of the icon.</param> /// <param name="x">An expression that's evaluated to determine a horizontal offset of the icon.</param> /// <param name="y">An expression that's evaluated to determine a vertical offset of the icon.</param> /// <param name="maxSize">A value used to determine the max size of the icon.</param> /// <param name="anchor">An anchor that all difference in scale is orientated around.</param> /// <param name="aspect">A value used to determine the aspect of the icon.</param> /// <param name="display">An expression that's evaluated to whether the icon should be displayed.</param> /// <param name="tint">A tint to apply to the icon.</param> /// <param name="layer">A value used to determine the layer of the icon.</param> /// <param name="fontStyle">A font style to use on all rendered text.</param> /// <param name="textAnchor">An anchor for all rendered text.</param> /// <param name="projection">A camera projection for all rendered Prefabs.</param> /// <param name="lineNumber">The line number that this attribute is implemented. Indended for compiler usage.</param> /// <param name="filePath">The local file path that this attribute is implemented. Indended for compiler usage.</param> public AssetIconAttribute( string width = "100%", string height = "100%", string x = "0", string y = "0", int maxSize = 64, IconAnchor anchor = IconAnchor.Center, IconAspect aspect = IconAspect.Fit, string display = "true", string tint = IconColor.White, int layer = 0, FontStyle fontStyle = FontStyle.Normal, IconAnchor textAnchor = IconAnchor.Center, IconProjection projection = IconProjection.Perspective, #if UNITY_EDITOR && (!NET_2_0 && !NET_2_0_SUBSET && UNITY_2017_1_OR_NEWER) [CallerLineNumber] #endif int lineNumber = -1, #if UNITY_EDITOR && (!NET_2_0 && !NET_2_0_SUBSET && UNITY_2017_1_OR_NEWER) [CallerFilePath] #endif string filePath = null ) { style = new AssetIconsStyle() { Width = width, Height = height, X = x, Y = y, MaxSize = maxSize, Anchor = anchor, Aspect = aspect, Tint = tint, Layer = layer, FontStyle = fontStyle, Projection = projection, Display = display, TextAnchor = textAnchor, }; this.lineNumber = lineNumber; this.filePath = filePath; }