// // Copyright (c) 2017 Anthony Marmont. All rights reserved. // Licensed for use under the Unity Asset Store EULA. See https://unity3d.com/legal/as_terms for full license information. // #pragma warning disable namespace AssetIcons { /// /// When changing the height, the anchor will change how much each side of the will change. /// Using anchors is the fastest and easiest way to position elements in an icon. /// /// /// The accepts an for styling. /// Below is an example of the being used to create a bar at the bottom of the assets icon. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Bottom, height: "10%")] /// public Color BottomBar { get; } /// } /// /// Anchoring the asset to the bottom of the icon and then adjusting the height results in a bar on the bottom of the icon. /// Anchoring the asset to corners of the icon can create handy annotations for assets. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.TopLeft, height: "10%", width: "15%")] /// public Color TopLeftTag { get; } /// } /// /// /// /// public enum IconAnchor { /// /// Anchored to the center of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "center" anchoring being used to shink the asset. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Center, width: "85%", height: "85%")] /// public Color Icon { get; } /// } /// /// /// /// This is the default value for the styling of . /// Center, /// /// Anchored to the top of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "top" anchoring being used to create a bar at the top of the asset. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Top, height: "10%")] /// public Color TopBar { get; } /// } /// /// Top, /// /// Anchored to the bottom of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "bottom" anchoring being used to create a bar at the bottom of the asset. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Bottom, height: "10%")] /// public Color BottomBar { get; } /// } /// /// Bottom, /// /// Anchored to the left of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "left" anchoring being used to create a bar on the left of the asset. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Left, width: "15%")] /// public Color LeftBar { get; } /// } /// /// Left, /// /// Anchored to the right of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "right" anchoring being used to create a bar on the right of the asset. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.Right, width: "15%")] /// public Color RightBar { get; } /// } /// /// Right, /// /// Anchored to the top-left of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "top-left" anchoring being used to create an icon in the top-left of the graphic.. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.TopLeft, width: "20%", height: "10%")] /// public Color SmallTag { get; } /// } /// /// TopLeft, /// /// Anchored to the top-right of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "top-right" anchoring being used to create an icon in the top-right of the graphic.. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.TopRight, width: "20%", height: "10%")] /// public Color SmallTag { get; } /// } /// /// /// /// It's not recommended to anchor small graphics in the top-right due to Unity Collab icon being drawn there. /// TopRight, /// /// Anchored to the bottom-left of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "bottom-left" anchoring being used to create an icon in the bottom-left of the graphic.. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.BottomLeft, width: "20%", height: "10%")] /// public Color SmallTag { get; } /// } /// /// BottomLeft, /// /// Anchored to the bottom-right of the graphic. /// /// /// The accepts an for styling. /// Below is an example of the "bottom-right" anchoring being used to create an icon in the bottom-right of the graphic.. /// /// using AssetIcons; /// using UnityEngine; /// /// [CreateAssetMenu(menuName = "Item")] /// public class Item : ScriptableObject /// { /// [AssetIcon(anchor: IconAnchor.BottomRight, width: "20%", height: "10%")] /// public Color SmallTag { get; } /// } /// /// BottomRight, } } #pragma warning restore