Ejemplo n.º 1
0
        public void SetContent <DiskSlice>(ref DiskSlice slice, string slotName) where DiskSlice : DiskSliceBase
        {
            Content content = default(Content);

            if (DictContent)
            {
                if (contentDict == null)
                {
                    Debug.LogWarning("Content dictionary is missing. Falling back to text label.");
                }
                else
                {
                    content = contentDict.GetContent(slotName);
                    if (content == null)
                    {
                        Debug.LogWarning($"No sprite is assigned to slot name \"{slotName}\". Falling back to text label.");
                    }
                }
            }

            if (content != null)
            {
                slice.SetContent(content);
                slice.SetContentRadialOffset(contentOffset);
                slice.SetContentScale(contentScale);
                slice.SetContentRotation(contentRotation);
            }
            else
            {
                slice.SetContent(slotName);
                slice.SetFontSize(fontSize);
                slice.SetTextOffset(textOffset);
            }
        }