Пример #1
0
 //TODO is this really the right script for this to live?
 //Called when there is an exception
 void LogCallback(string condition, string stackTrace, LogType type)
 {
     if (type == LogType.Error || type == LogType.Exception)
     {
         AnalyticsLogger.UpdateLogFile(condition + " - " + stackTrace);
     }
 }
Пример #2
0
    private void ActivateCurrentLevel()
    {
        AnalyticsLogger.UpdateLogFile("--------Level " + (currentLevelNumber + 1) + " activated--------", false, true);

        int highscore = GameManager.GetHighscore(currentLevelNumber);

        uiManager.UpdateInfo(currentLevelNumber, highscore);
        levelManagers[currentLevelNumber].ActivateLevel();
    }
Пример #3
0
 public virtual void DeactivateLevel()
 {
     HideAllLevelText();
     levelActive = false;
     gameObjectsHolder.SetActive(false);
     foodPrompt.enabled = false;
     questionsManager.HideQuestion();
     voiceover.Stop();
     AnalyticsLogger.UpdateLogFile("Fps over last level: " + numberOfFrames / (Time.time - framerateTimer));
 }
Пример #4
0
    private void RandomizeMaze()
    {
        AnalyticsLogger.UpdateLogFile("Round " + (currentRound + 1));

        int activeMazeVariation = Random.Range(0, 3);

        for (int i = 0; i < NUMBER_OF_ROUNDS; i++)
        {
            mazes[currentRound][i].SetActive(i == activeMazeVariation);
        }

        spiderSpotlight.SetTarget(ceilingSpider);
    }
Пример #5
0
    private void StartNextRound()
    {
        AnalyticsLogger.UpdateLogFile("Round " + (currentRound + 1));
        raceStartTime = -1;

        for (int i = 0; i < NUMBER_OF_ROUNDS; i++)
        {
            bool indexAtCurrentRound = i == currentRound;
            spiders[i].SetActive(indexAtCurrentRound);
            mazes[i].SetActive(indexAtCurrentRound);
        }

        spiderSpotlight.SetTarget(spiders[currentRound]);
        //Debug.Log("SET POS " + spiders[currentRound].gameObject.name);
    }
Пример #6
0
    public void Begin()
    {
        currentLevelNumber = GameManager.startingLevel;
        AnalyticsLogger.UpdateLogFile("--------Level " + (currentLevelNumber + 1) + " activated--------", false, true);
        Debug.Log("LEVEL: " + (currentLevelNumber + 1) + "/" + levelManagers.Count);
        levelManagers[currentLevelNumber].ActivateLevel();

        int highscore = GameManager.GetHighscore(currentLevelNumber);

        if (uiManager == null)
        {
            Debug.Log("Warning - UI Manager null in " + gameObject.name + "'s PSM");
            uiManager = GameObject.FindGameObjectWithTag("UIManagerObject").GetComponent <UIManager>();
        }
        uiManager.ToggleLevelSelectionUI(false);
        uiManager.UpdateInfo(currentLevelNumber, highscore);
    }
Пример #7
0
    public void NextLevel(int suds)
    {
        AnalyticsLogger.UpdateLogFile("Level " + (currentLevelNumber + 1) + " completed, score: " + (int)Math.Round(LevelManager.score) + ", SUDS: " + suds);

        GameManager.UpdateSave(currentLevelNumber, (int)Math.Round(LevelManager.score), suds);

        //Don't need to deactivate the level here as that happens when the SUDS UI switches on
        currentLevelNumber++;

        if (currentLevelNumber < levelManagers.Count)
        {
            ActivateCurrentLevel();
        }
        else
        {
            //TODO show some kind of special "you finished this mode" screen, return to level selection?
        }
    }
Пример #8
0
    private void OnEnable()
    {
        AnalyticsLogger.UpdateLogFile("--------Main Menu--------");

        for (int i = 0; i < 10; i++)
        {
            levelRowManager[i] = LevelRowGO[i].GetComponent <LevelSelectionRowManager>();

            //TODO deal with 2 and 3 stars
            float score = GameManager.GetHighscore(i);
            if (score == 100)
            {
                //Debug.Log("Setting stars");
                levelRowManager[i].SetNumberOfStars(1);
            }
            else
            {
                levelRowManager[i].SetScore(GameManager.GetHighscore(i)); //TODO deal with stars
            }
        }
    }
Пример #9
0
    private SpiderManager GetSpiderManager()
    {
        SpiderManager[] spiderManagers = gameObject.GetComponents <SpiderManager>();

        //If we have two spider managers, disable the ceiling spider manager and return the other one
        if (spiderManagers.Length > 1)
        {
            foreach (SpiderManager managerInArray in spiderManagers)
            {
                if (managerInArray is CeilingSpiderFollowController && managerInArray.enabled)
                {
                    AnalyticsLogger.UpdateLogFile("Ceiling spider grabbed off silk");
                    ((CeilingSpiderFollowController)managerInArray).SwitchToRandomPathing();
                }
                else
                {
                    spiderManager = managerInArray;
                }
            }
        }

        return(spiderManager);
    }
Пример #10
0
    public override void Awake()
    {
        base.Awake();

        //Setup initial prefs
        if (PlayerPrefs.GetInt(SettingsManager.graphicsSettingName) == 0)
        {
            //If this is the first boot of the system, and player is using a quest, turn on performance lighting
            if (OVRPlugin.GetSystemHeadsetType() == OVRPlugin.SystemHeadset.Oculus_Quest ||
                OVRPlugin.GetSystemHeadsetType() == OVRPlugin.SystemHeadset.Oculus_Quest_2 ||
                OVRPlugin.GetSystemHeadsetType() == OVRPlugin.SystemHeadset.Oculus_Link_Quest ||
                OVRPlugin.GetSystemHeadsetType() == OVRPlugin.SystemHeadset.Oculus_Link_Quest_2)
            {
                AnalyticsLogger.UpdateLogFile("Detecting Oculus Quest - lowering lighting quality");
                PlayerPrefs.SetInt(SettingsManager.graphicsSettingName, 1);
                TogglePerformanceLighting(true);
            }
            else
            {
                PlayerPrefs.SetInt(SettingsManager.graphicsSettingName, 2);
            }
        }
        else if (PlayerPrefs.GetInt(SettingsManager.graphicsSettingName) == 1)
        {
            TogglePerformanceLighting(true);
        }

        if (PlayerPrefs.GetInt(SettingsManager.colorblindSettingName) == 0)
        {
            PlayerPrefs.SetInt(SettingsManager.colorblindSettingName, 1);
        }

        if (PlayerPrefs.GetInt(SettingsManager.usageDataSettingName) == 0)
        {
            PlayerPrefs.SetInt(SettingsManager.usageDataSettingName, 2);
        }
    }
Пример #11
0
 protected virtual void BumpOffSurface()
 {
     rb.AddForce(localUp * BUMP_FORCE, ForceMode.Impulse);
     AnalyticsLogger.UpdateLogFile("Spider fell off surface");
 }
Пример #12
0
 public void ResetLevel(int suds)
 {
     AnalyticsLogger.UpdateLogFile("---Level " + (currentLevelNumber + 1) + " reset with score " + (int)LevelManager.score + " and SUDS " + suds + "---");
     SubmitLevelDetails(suds);
     ResetLevel();
 }
Пример #13
0
 public void ResetLevel()
 {
     AnalyticsLogger.UpdateLogFile("---Level " + (currentLevelNumber + 1) + " reset with score " + (int)LevelManager.score + "---");
     levelManagers[currentLevelNumber].ResetLevel();
 }
Пример #14
0
 private void Awake()
 {
     AnalyticsLogger.UpdateLogFile("------------------- NEW SESSION " + OVRPlugin.GetSystemHeadsetType().ToString() + " -------------------", true);
 }