Exemplo n.º 1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
 }
Exemplo n.º 2
0
        // Zeugnisfach speichern und auf vorherige Seite zurückkehren
        private void OnBtnSpeichern(string obj)
        {
            ZF.Speichern();

            // Zeugnisfachliste im FaecherVerwaltenVM aktualisieren
            if (Modus == DialogMode.Neu)
            {
                fvvm.Zfaecher.Add(ZF);
                fvvm.SelectedZFach = ZF;
            }
            else if (Modus == DialogMode.Aendern)
            {
                int ind = fvvm.Zfaecher.IndexOf(ZF);
                fvvm.Zfaecher.RemoveAt(ind);
                fvvm.Zfaecher.Insert(ind, ZF);
                fvvm.SelectedZFach = ZF;
            }

            Navigator.Instance.NavigateTo(obj);
        }