Beispiel #1
0
        override internal void Visit(Panel panelDescr, PanelBase panelUI)
        {
            string text_name   = NamesFormatter.ObjectName(this.Name, "Label");
            var    text_object = PrefabsHelper.CreateObject("Text", text_name);
            var    c_text      = text_object.GetComponent <UnityEngine.UI.Text>();

            c_text.text = text;
            text_object.transform.SetParent(panelUI.transform);
        }
Beispiel #2
0
        override internal void Visit(Panel panelDescr, PanelBase panelUI)
        {
            var    fields      = panelDescr.ComponentType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
            string button_name = NamesFormatter.ObjectName(this.Name, "Button");

            var button = PrefabsHelper.CreateObject("Button", button_name);

            button.transform.SetParent(panelUI.transform);

            UnityButton ui_button = button.GetComponent <UnityButton>();

            string field_name = NamesFormatter.PrivateMember(this.Name, "Button");

            foreach (var field in fields)
            {
                if (field.Name == field_name)
                {
                    field.SetValue(panelUI, ui_button);
                }
            }
        }
Beispiel #3
0
        override internal void Visit(Panel panelDescr, PanelBase panelUI)
        {
            string list_name = NamesFormatter.ObjectName(this.Name, "List");

            var list = PrefabsHelper.CreateObject("Scroll View", list_name);

            list.transform.SetParent(panelUI.transform);
            list.transform.ResetTransform();

            /*
             * var fields = panelDescr.ComponentType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
             * string field_name = NamesFormatter.PrivateMember(this.Name, "List");
             * foreach(var field in fields)
             *{
             *    if (field.Name == field_name)
             *    {
             *        field.SetValue(panelUI, list);
             *    }
             *}
             */
        }