/// <summary> /// Constructor with dependency injection /// </summary> /// <param name="script">The script which owns this menu</param> internal VStancerMenu(VStancerEditor script) { vstancerEditor = script; vstancerEditor.PresetChanged += new EventHandler((sender, args) => UpdateEditorMenu()); vstancerEditor.ToggleMenuVisibility += new EventHandler((sender, args) => { if (editorMenu == null) { return; } editorMenu.Visible = !editorMenu.Visible; }); InitializeMenu(); Tick += OnTick; }