public static LegoInputFieldMeta Create(YuLegoInputField inputField)
        {
            var rect = inputField.RectTransform;
            var meta = new LegoInputFieldMeta
            {
                Transition    = inputField.transition.ToString().AsEnum <LegoTransition>(),
                ColorTintMeta = LegoColorTintMeta.Create(inputField),
                InputSoundId  = inputField.SoundEffectId
            };

            var image = inputField.GetComponent <YuLegoImage>();

            meta.RootImageMeta = LegoImageMeta.Create(image);

            var textPlaceHolder = rect.Find("Placeholder");

            meta.PlaceHolderTextRectMeta = LegoRectTransformMeta
                                           .Create(textPlaceHolder.GetComponent <RectTransform>());
            meta.PlaceHolderTextMeta = LegoTextMeta.Create(textPlaceHolder.GetComponent <YuLegoText>());

            var textContent = rect.Find("Text");

            meta.ContentTextRectMeta = LegoRectTransformMeta.Create(textContent.RectTransform());
            meta.ContentTextMeta     = LegoTextMeta.Create(textContent.GetComponent <YuLegoText>());

            return(meta);
        }
Esempio n. 2
0
        private void AddInputFieldMeta(Transform transform)
        {
            var inputFieldMeta = LegoInputFieldMeta.Create(
                transform.GetComponent <YuLegoInputField>());

            InputFieldMetas.Add(inputFieldMeta);
        }