public MonitoringUserControl() { InitializeComponent(); tabControl1.TabPages[0].Text = "График"; tabControl1.TabPages[1].Text = "Индикаторы"; uc = wpf.UserControl1.Instance; management = new ManagerGraph(bufferDataGraph, OxyPlotGraphView.Model); management.DrawOxyPlotGraph(1); comboBoxViewPoints.SelectedIndex = 0; MonitoringOfIndicators(); }
void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } }