Ejemplo n.º 1
0
        public async Task <Result> UpdateAsync(AudioLogic audio, UserLogic user)
        {
            try
            {
                if (user.IsAdmin || user.UploadedCourses.Contains(audio.Course))
                {
                    var audioDb = mapper.Map <AudioLogic, AudioDb>(audio);
                    await dbmanager.UpdateAsync(audioDb);

                    return(Result.Ok());
                }
                else
                {
                    return(Result.Fail("Unauthorized"));
                }
            }
            catch (DbUpdateConcurrencyException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (DbUpdateException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (DbEntityValidationException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (Exception)
            {
                return(Result.Fail("Exception"));
            }
        }
Ejemplo n.º 2
0
 void Start()
 {
     //gameObject.GetComponentInChildren<ParticleSystem>().Stop();
     startPos   = transform.position;
     gameLogic  = FindObjectOfType <GameLogic>();
     audioLogic = FindObjectOfType <AudioLogic>();
 }
        public void AudioLogicTest()
        {
            AudioLogic audioLogic = new AudioLogic(null);

            Task.Run(() => audioLogic.StartAudioAlgorithm());

            audioLogic._AlgorithmCanceled = true;
        }
Ejemplo n.º 4
0
 // Start is called before the first frame update
 void Start()
 {
     audioLogic      = GetComponent <AudioLogic>();
     allCoins        = GameObject.FindGameObjectsWithTag("Coin").Length;
     winText.enabled = false;
     UpdateText(true);
     print(allCoins);
 }
Ejemplo n.º 5
0
    private void Start()
    {
        Time.timeScale = 1;

        score    = 0;
        distance = 0;
        speed    = 5;

        characterLogic = FindObjectOfType <CharacterLogic>();
        enemyGenerator = FindObjectOfType <EnemyGenerator>();
        gemGenerator   = FindObjectOfType <GemGenerator>();
        audioLogic     = FindObjectOfType <AudioLogic>();

        if (PlayerPrefs.HasKey("HighScore"))
        {
            highScore = PlayerPrefs.GetFloat("HighScore", 0);
        }

        GameOverPanel.SetActive(false);
    }
Ejemplo n.º 6
0
        public async Task <Result> AddAsync(AudioLogic audio, UserLogic user)
        {
            try
            {
                if (user.UploadedCourses.Contains(audio.Course) || user.IsAdmin)
                {
                    var course = audio.Course;
                    audio.Content = Guid.NewGuid().ToString();
                    audio.Id      = Guid.NewGuid().ToString();
                    var audioDb = mapper.Map <AudioLogic, AudioDb>(audio);
                    var result  = await dbmanager.AddAsync(audioDb);

                    return(Result.Ok());
                }
                else
                {
                    return(Result.Fail("Unauthorized"));
                }
            }
            catch (DbUpdateConcurrencyException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (DbUpdateException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (DbEntityValidationException e)
            {
                return(Result.Fail(e.Message));
            }
            catch (Exception)
            {
                return(await Task.FromResult(Result.Fail("Exception")));
            }
        }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     m_audioLogic          = FindObjectOfType <AudioLogic>();
     m_characterController = GetComponent <CharacterController>();
 }
Ejemplo n.º 8
0
 // Start is called before the first frame update
 void Start()
 {
     m_audioLogic = FindObjectOfType <AudioLogic>();
     EnemyHealth  = 60;
 }
Ejemplo n.º 9
0
 public AudioController(AudioLogic audioLogic, JsonHandler jsonHandler)
 {
     _audioLogic  = audioLogic;
     _jsonHandler = jsonHandler;
 }
Ejemplo n.º 10
0
 private void Start()
 {
     audioLogic = FindObjectOfType <AudioLogic>();
 }