コード例 #1
0
ファイル: EventEditor.cs プロジェクト: 0x5b25/RTSPrototype
 public static void InitWindow()
 {
     window = GetWindow <EventEditor>();
     window.titleContent = new GUIContent("Event Editor");
     window.Construct();
     window.Show();
 }
コード例 #2
0
ファイル: EventEditor.cs プロジェクト: 0x5b25/RTSPrototype
        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);
        }