Пример #1
0
        void Start()
        {
            sceneManager = gameManager.GetComponentInChildren <SceneManager>();
            soundManager = gameManager.GetComponentInChildren <SoundManager>();
            musicManager = gameManager.GetComponentInChildren <MusicManager>();

            patients = Model.All <Patient>();

            if (patients.Count == 0)
            {
                sceneManager.LoadNewPatientMenu();
            }

            menu = Model.GetModel <Menu>(this.name);
            menuTitleObject.GetComponent <Text>().text = menu.Name;

            foreach (var menuEntry in this.menuEntries)
            {
                menuEntry.GetComponentInChildren <Text>().text = menu.Entries[menuEntry.name].Entry;
            }

            soundManager.Enqueue(menu.AuditiveName);
            musicManager.AddMusic(menu.Music);
            CreatePatientButtons();
        }
Пример #2
0
        void Start()
        {
            menu = Model.GetModel <Menu>(this.name);

            soundManager = gameManager.GetComponentInChildren <SoundManager>();
            musicManager = gameManager.GetComponentInChildren <MusicManager>();

            menuTitleObject.GetComponent <Text>().text = menu.Name;

            soundManager.Enqueue(menu.AuditiveName);
            musicManager.AddMusic(menu.Music);
        }
Пример #3
0
        void Start()
        {
            menu = Model.GetModel <Menu>(this.name);

            soundManager = gameManager.GetComponentInChildren <SoundManager>();
            musicManager = gameManager.GetComponentInChildren <MusicManager>();

            menuTitleObject.GetComponent <Text>().text = menu.Name;

            foreach (var menuEntry in this.menuEntries)
            {
                menuEntry.GetComponent <Text>().text = menu.Entries[menuEntry.name].Entry;
            }

            soundManager.Enqueue(menu.AuditiveName);
            musicManager.AddMusic(menu.Music);
        }
Пример #4
0
        void Start()
        {
            var menu = Model.GetModel <Menu>(this.name);

            male   = Model.GetModel <ValueTranslation>("male");
            female = Model.GetModel <ValueTranslation>("female");

            soundManager   = gameManager.GetComponentInChildren <SoundManager>();
            musicManager   = gameManager.GetComponentInChildren <MusicManager>();
            patientManager = gameManager.GetComponent <PatientManager>();
            sceneManager   = gameManager.GetComponent <SceneManager>();

            menuTitleObject.GetComponent <Text>().text = menu.Name;
            nameLabelObject.GetComponent <Text>().text = string.Format("{0}: ", menu.Entries["name"].Entry);
            ageLabelObject.GetComponent <Text>().text  = string.Format("{0}: ", menu.Entries["age"].Entry);
            sexLabelObject.GetComponent <Text>().text  = string.Format("{0}: ", menu.Entries["sex"].Entry);

            nameInput            = nameInputObject.GetComponent <InputField>();
            namePlaceholder      = nameInputObject.transform.Find("namePlaceholder").GetComponent <Text>();
            namePlaceholder.text = menu.Entries["name"].Placeholder;

            ageInput = ageInputObject.GetComponent <InputField>();

            sexInput = sexInputObject.GetComponent <Dropdown>();

            options = new List <string>();
            options.Add(male.Translation);
            options.Add(female.Translation);
            sexInput.AddOptions(options);

            nameClip      = menu.Entries["name"].AuditiveEntry;
            ageClip       = menu.Entries["age"].AuditiveEntry;
            sexClip       = menu.Entries["sex"].AuditiveEntry;
            deleteClip    = menu.Entries["deletePatient"].AuditiveEntry;
            statisticClip = menu.Entries["statistic"].AuditiveEntry;
            saveClip      = menu.Entries["savePatient"].AuditiveEntry;
            maleClip      = male.AuditiveTranslation;
            femaleClip    = female.AuditiveTranslation;

            saveButtonObject.GetComponentInChildren <Text>().text      = menu.Entries["savePatient"].Entry;
            statisticButtonObject.GetComponentInChildren <Text>().text = menu.Entries["statistic"].Entry;
            deleteButtonObject.GetComponentInChildren <Text>().text    = menu.Entries["deletePatient"].Entry;

            soundManager.Enqueue(menu.AuditiveName);
            musicManager.AddMusic(menu.Music);


            if (GameManager.ActivePatient != null)
            {
                nameInput.text = GameManager.ActivePatient.Name;
                var age = GameManager.ActivePatient.Age.ToString();
                ageInput.text  = age;
                sexInput.value = (int)GameManager.ActivePatient.Sex;

                sexInput.transform.FindChild("Label").GetComponent <Text>().text = GameManager.ActivePatient.Sex == Sex.male ? male.Translation : female.Translation;

                sexInput.RefreshShownValue();

                GameObject.Find("EventSystem").GetComponent <EventSystem>().firstSelectedGameObject = saveButtonObject;
            }
            else
            {
                sexInput.GetComponentInChildren <Text>().text = options[0];
                statisticButtonObject.SetActive(false);
                deleteButtonObject.SetActive(false);
            }
        }
Пример #5
0
 public IActionResult AddMusic([FromForm] AddMusicModel model)
 {
     return(musicManager.AddMusic(model, UserId).Result);
 }