Beispiel #1
0
    IEnumerator bombCue(float explosionDelay, float stereo)
    {
        var channel = channelDict["bomb" + soundMode.ToString()];
        var source  = GetNewSource(channel);

        source.volume = PlayerPrefs.GetFloat("Volume");
        if (explosionDelay >= 4)
        {
            yield return(new WaitForSeconds(explosionDelay - 4));
        }
        else
        {
            source.pitch = (4 * (1 / explosionDelay));
        }

        source.Play();
    }
Beispiel #2
0
        public virtual string ToHtmlString( )
        {
            string dismissible = null;
            string button      = null;

            if (Dismissible)
            {
                dismissible = DismissibleClass;
                button      = ButtonHtmlString;
            }

            return
                ($"<div class=\"alert alert-{Variation . ToString ( ) . ToLower ( )}{dismissible}\" role=\"alert\">\n{Content}{button}\n</div>");
        }
Beispiel #3
0
        public IQuestionBuilder SetupBuilder()
        {
            IQuestionBuilder builder = null;

            int nPacks   = 10;
            int nCorrect = 1;
            int nWrong   = 5;

            var builderParams = new Teacher.QuestionBuilderParameters();

            switch (Variation)
            {
            case ToboganVariation.LetterInAWord:
                builder = new LettersInWordQuestionBuilder(nPacks, nCorrect, nWrong, parameters: builderParams);
                break;

            case ToboganVariation.SunMoon:
                builder = new WordsBySunMoonQuestionBuilder(nPacks, parameters: builderParams);
                break;
            }

            if (builder == null)
            {
                throw new System.Exception("No question builder defined for variation " + Variation.ToString());
            }

            return(builder);
        }
Beispiel #4
0
        public IQuestionBuilder SetupBuilder()
        {
            IQuestionBuilder builder = null;

            SetupVariables();

            int nPacks = 7;             // One Extra for tutorial

            nCorrect = 1;
            int nWrong = 4;

            var builderParams = new Teacher.QuestionBuilderParameters();

            builderParams.wordFilters.excludeColorWords = true;
            builderParams.wordFilters.requireDrawings   = true;

            switch (Variation)
            {
            case ScannerVariation.OneWord:
                nCorrect = 1;
                nWrong   = 4;
                break;

            case ScannerVariation.MultipleWords:
                if (Difficulty < 0.5f)
                {
                    nCorrect = 3;
                }
                else
                {
                    nCorrect = 5;
                }
                nWrong = 0;
                break;
            }

            builder = new RandomWordsQuestionBuilder(nPacks, nCorrect, nWrong, parameters: builderParams);


            if (builder == null)
            {
                throw new System.Exception("No question builder defined for variation " + Variation.ToString());
            }


            return(builder);
        }