Beispiel #1
0
        public async Task <HazardInfo> CreateHazardInfo(HazardInfo hazardInfo)
        {
            var response = await _httpClient.PostAsJsonAsync("hazardinfo-create", hazardInfo);

            if (response.IsSuccessStatusCode)
            {
                return(await response.Content.ReadFromJsonAsync <HazardInfo>());
            }
            else
            {
                throw new Exception("Error saving hazard info");
            }
        }
Beispiel #2
0
        private void Init()
        {
            Transform _independent = transform.Find("Independent");

            if (!_independent.gameObject.activeInHierarchy)
            {
                GameObject _player = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/Player"));
                SetNormalPosition(_player);
                GameObject _hud = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/TutorialHUD"));
                SetNormalPosition(_hud);

                GameObject _clone = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/SAFETY_AWARENESS"));
                SetNormalPosition(_clone);
                trainingChapter = _clone;
                _clone          = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/ValveOperations"));
                SetNormalPosition(_clone);
                valveChapter = _clone;
                _clone       = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/DRILLING_RIG_UP"));
                SetNormalPosition(_clone);
                drillingChapter = _clone;
                _clone          = Instantiate(Resources.Load <GameObject>("Prefabs/GamePlay/TrainingItems/EmergencySituation"));
                SetNormalPosition(_clone);
                EmergencySituation = _clone;
            }
            else
            {
                trainingChapter    = _independent.Find("SAFETY_AWARENESS").gameObject;
                valveChapter       = _independent.Find("ValveOperations").gameObject;
                drillingChapter    = _independent.Find("DRILLING_RIG_UP").gameObject;
                EmergencySituation = _independent.Find("EmergencySituation").gameObject;
            }
            fireBoxInfo     = FindObjectOfType <FireBoxInfo>();
            situationInfoUI = FindObjectOfType <SituationInfoUI>();
            hazardInfo      = FindObjectOfType <HazardInfo>();
            vRMovement      = FindObjectOfType <VRMovement>();
            DeactivateCurrentChapter();
        }
Beispiel #3
0
 public Task <HazardInfo> SaveHazardInfo(HazardInfo hazardInfo)
 {
     return(Task.FromResult(hazardInfo));
 }