#define Graph_And_Chart_PRO using ChartAndGraph; using System; using UnityEngine; using UnityEngine.UI; [Serializable] public abstract class ItemLabelsBase : ChartSettingItemBase,ISerializationCallbackReceiver { /// /// This prefab will be used to create all the text associated with the chart. If the prefab is null no labels will be shown /// [SerializeField] [Tooltip("This prefab will be used to create all the text associated with the chart. If the prefab is null no labels will be shown")] private MonoBehaviour textPrefab; /// /// This prefab will be used to create all the text associated with the chart. If the prefab is null no labels will be shown /// public MonoBehaviour TextPrefab { get { return textPrefab; } set { textPrefab = value; RaiseOnChanged(); } } public ItemLabelsBase() { AddChildObjects(); } void AddChildObjects() { if (textFormat != null) AddInnerItem(textFormat); } /// /// determine the formatting of the label data. when the values are available , you can use the predefined macros : "\n" for newline , '' for the current category and '' for the current group /// [SerializeField] [Tooltip(@" determine the formatting of the label data. when the values are available , you can use the predefined macros : '\n' for newline , '' for the current category and '' for the current group")] private TextFormatting textFormat = new TextFormatting(); /// /// determine the formatting of the label data. when the values are available , you can use the predefined macros : "\n" for newline , '' for the current category and '' for the current group /// public TextFormatting TextFormat { get { return textFormat; } set { textFormat = value; RaiseOnUpdate(); } } /// /// The size of the text. /// [SerializeField] [Tooltip("the font size for the labels")] private int fontSize = 14; /// /// The size of the text. /// public int FontSize { get { return fontSize; } set { fontSize = value; RaiseOnUpdate(); } } /// /// adjusts the sharpness of the font /// [SerializeField] [Range(1f,3f)] [Tooltip("adjusts the sharpness of the font")] private float fontSharpness = 1f; /// /// adjusts the sharpness of the font /// public float FontSharpness { get { return fontSharpness; } set { fontSharpness = value; RaiseOnUpdate(); } } /// /// the seperation of each label from it's origin /// [SerializeField] [Tooltip("the seperation of each label from it's origin")] private float seperation = 1f; /// /// the seperation of each label from it's origin /// public float Seperation { get { return seperation; } set { seperation = value; RaiseOnUpdate(); } } /// /// validates all properties /// public virtual void ValidateProperties() { fontSize = Mathf.Max(fontSize, 0); fontSharpness = Mathf.Clamp(fontSharpness, 1f, 3f); } /// /// the location of the label relative to the item /// [SerializeField] [Tooltip("the location of the label relative to the item")] private ChartOrientedSize location = new ChartOrientedSize(0f,0f); /// /// the location of the label relative to the item /// public ChartOrientedSize Location { get { return location; } set { location = value; RaiseOnUpdate(); } } void ISerializationCallbackReceiver.OnBeforeSerialize() { } void ISerializationCallbackReceiver.OnAfterDeserialize() { AddChildObjects(); } }