public PageWaves(AudioCore core) { InitializeComponent(); vm = new PageWavesViewModel(core); DataContext = vm; }
public Main() { InitializeComponent(); audioCore = new AudioCore(); BtnPageWaves_Click(BtnPageWaves, null); // allow only one instance of MicGate to run. Limit based on assembly GUID var guid = ((GuidAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(GuidAttribute), false)).Value; singleInstanceMutex = new Mutex(true, guid, out var isNewInstance); if (!isNewInstance) { MessageBox.Show("An instance of MicGate is already running. The newly opened instance will be closed now."); closeInsteadOfMinimize = true; Application.Current.Shutdown(); } // minimizing has more steps than just setting WindowState. Thus use the functions. if (Utility.StrToBool(Utility.ReadSetting("StartWindowMinimized"))) { Window_Closing(null, null); } else { TrayIconOpen_Click(null, null); } }
private void Awake() { if (main != null && main != this) { Destroy(this.gameObject); } else { main = this; DontDestroyOnLoad(this.gameObject); } }
public Main() { InitializeComponent(); audioCore = new AudioCore(); BtnPageWaves_Click(BtnPageWaves, null); // allow only one instance of MicGate to run. Limit based on assembly GUID var guid = ((GuidAttribute)Attribute.GetCustomAttribute(Assembly.GetExecutingAssembly(), typeof(GuidAttribute), false)).Value; singleInstanceMutex = new Mutex(true, guid, out var isNewInstance); if (!isNewInstance) { MessageBox.Show("An instance of MicGate is already running. The newly opened instance will be closed now."); closeInsteadOfMinimize = true; Application.Current.Shutdown(); } TrayIconOpen_Click(null, null); }
public void CreatePlayerAndUI(GameObject go, GameObject ui, GameObject audio) { _player = Instantiate(go); _player.name = "Player"; _player.transform.parent = gameObject.transform; _ui = Instantiate(ui); _ui.name = "UI"; _ui.transform.parent = gameObject.transform; GameObject audioGo = Instantiate(audio); audioGo.name = "Audio"; audioGo.transform.parent = gameObject.transform; _audio = audioGo.GetComponent <AudioCore>(); _player.GetComponent <PlayerCore>().StartUp(); _player.SetActive(false); _ui.SetActive(false); }