Esempio n. 1
0
        public static void PopulateNameOutlet(this DTEntity entity, TextOutlet textOutlet)
        {
            DisplayComponent displayComponent = entity.GetComponent <DisplayComponent>();

            if (displayComponent == null)
            {
                Debug.LogError("PopulateNameOutlet - failed to get display component!");
                return;
            }

            textOutlet.Text = displayComponent.displayName;
        }
Esempio n. 2
0
        public static void SetLocalizedKey(this TextOutlet textOutlet, string key)
        {
            if (textOutlet.GameObject == null)
            {
                Debug.LogWarning("SetLocalizedKey on invalid text outlet with no GameObject!");
                return;
            }

            var localizedText = textOutlet.GameObject.GetOrAddComponent <LocalizedText>();

            localizedText.SetUnityText(textOutlet.UnityText);
                        #if TMPRO
            localizedText.SetTMProText(textOutlet.TMPText);
                        #endif

            localizedText.SetKey(key);
        }