コード例 #1
0
ファイル: GameSettings.cs プロジェクト: mecha-rm/GDW_Y3-PJT
    // saves the game settings
    public void SaveSettings()
    {
        // uses the metric logger to save the settings
        MetricsLogger prefLog = new MetricsLogger();

        // adjusts the volume
        // TODO: maybe move this function or put it into this game settings file.
        SettingsInterface.AdjustVolume();

        // Saving Content to Fle
        // sets the logger file
        prefLog.SetLoggerFile(FILE_NAME);

        // TODO: add function to metrics to see if the file exists.
        // see what happens if the file isn't there.

        // adds the contents
        // master volume
        prefLog.AddMetricToLogger(LBL_MASTER_VOL, masterVolume);

        // bgm volume
        prefLog.AddMetricToLogger(LBL_BGM_VOL, bgmVolume);

        // sound effects
        prefLog.AddMetricToLogger(LBL_SFX_VOL, sfxVolume);

        // saves the data
        prefLog.SaveMetrics();
    }
コード例 #2
0
    // completes a step, which pops it off of the queue.
    public void CompleteStep()
    {
        // if there are no steps
        if (steps.Count == 0)
        {
            OnCompleteList();
        }

        Step doneStep = steps[currentStep];

        doneStep.OnStepCompletion();

        // if the step should be destroyed.
        // if (destroySteps)
        //     Destroy(doneStep);

        currentStep++;
        // stepsCompleted++;

        // list is completed.
        if (currentStep >= steps.Count)
        {
            OnCompleteList();
        }
        else // if there are still steps remaining.
        {
            steps[currentStep].OnStepActivation();
        }

        // lap
        if (timer != null)
        {
            // splits the time
            timer.SplitTime();

            // logs the metric
            if (logMetrics)
            {
                logger.AddMetricToLogger("STEP" + (currentStep), timer.GetSplitAtIndex(timer.GetSplitAmount() - 1));
            }
        }
    }