示例#1
0
 public static void InitWindow()
 {
     window = GetWindow <EventEditor>();
     window.titleContent = new GUIContent("Event Editor");
     window.Construct();
     window.Show();
 }
示例#2
0
        public EventContentLine(int index, EventEditor parent)
        {
            this.index  = index;
            this.parent = parent;
            indexText   = new EText().Content(index.ToString()).RelativeSize(false).Width(20);
            nameField   = new ETextInputField().RelativeSize(true).OnInputUpdate((ETextInputField f, string val) => { parent.cfg.events[this.index] = val; nameText.Content(val); });
            nameText    = new EText().Content(parent.cfg.events[index]).RelativeSize(true);

            editButton       = new EButton().RelativeSize(false).Width(80).OnClicked((EButton b) => { parent.BeginEdit(index); }) + new EText().Content("edit");
            editFinishButton = new EButton().RelativeSize(false).Width(50).OnClicked((EButton b) => { parent.FinishEdit(); }) + new EText().Content("finish");
            deleteButton     = new EButton().RelativeSize(false).Width(30).OnClicked((EButton b) => { parent.RemoveEvent(index); }) + new EText().Content("x");

            children.Add(new EHorizontalLayout() + indexText + nameText + editButton);
            children.Add(new EHorizontalLayout() + indexText + nameField + editFinishButton + deleteButton);
            children.Add(new EHorizontalLayout() + indexText + nameText);
            this.OnConstruct(parent);
        }