Beispiel #1
0
    /// <summary>
    /// Set up the GUI.
    /// </summary>
    private void SetUpGUI()
    {
        // First, create an instance of the view we want to bind the GUI to
        var viewModel = new ExampleView();

        // Set up the GUI widgets
        gui = new UnityEditorUI.GUI();
        gui.Root()
        .Label()
        .Text.Value("My new editor window")
        .End()
        .Button()
        .Text.Value("Do something!")
        .Click.Bind(() => viewModel.DoSomething())
        .Tooltip.Value("Click to trigger an event")
        .End();

        // Bind the resulting GUI to the view.
        gui.BindViewModel(viewModel);
    }