예제 #1
0
        public PageWaves(AudioCore core)
        {
            InitializeComponent();

            vm          = new PageWavesViewModel(core);
            DataContext = vm;
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 private void Awake()
 {
     if (main != null && main != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         main = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
예제 #4
0
파일: Main.xaml.cs 프로젝트: onoki/MicGate
        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);
        }
예제 #5
0
    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);
    }