void OnDisable() { SaveData(); DrawGraph.Clear(); DrawGraph.onInput -= OnInput; }
public void AddItemsToMenu(GenericMenu menu) { GraphStrings.MenuStrings(); menu.AddItem(GraphStrings.MenuAutoOpen, data.autoOpen, () => { data.autoOpen = !data.autoOpen; SaveData(); }); menu.AddItem(GraphStrings.MenuDataLength, data.showCounts, () => { data.showCounts = !data.showCounts; SaveData(); }); menu.AddItem(GraphStrings.MenuHeaderValues, data.showValues, () => { data.showValues = !data.showValues; SaveData(); }); menu.AddSeparator(""); if (DrawGraph.Singelton().hasData) { menu.AddItem(GraphStrings.MenuClearAll, false, () => DrawGraph.Clear()); } else { menu.AddDisabledItem(GraphStrings.MenuClearAll); } menu.AddSeparator(""); menu.AddItem(GraphStrings.MenuExpandAll, false, () => DrawGraph.Singelton().data.Values.ToList().ForEach(item => item._.visible = true)); menu.AddItem(GraphStrings.MenuCollapseAll, false, () => DrawGraph.Singelton().data.Values.ToList().ForEach(item => item._.visible = false)); menu.AddSeparator(""); menu.AddDisabledItem(GraphStrings.MenuDefaultItems); }