Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        // get access to some of the different objects
        difficultyDropdown = UIHelp.getAccessTo <Dropdown>("Difficulty");
        levelSizeDropdown  = UIHelp.getAccessTo <Dropdown>("LevelSize");
        movingWallsToggle  = UIHelp.getAccessTo <Toggle>("MovingWalls");

        settingsInfo = Object.FindObjectOfType <SettingsInfo>();

        // store difficulty settings
        if (difficultyDropdown != null && settingsInfo != null)
        {
            settingsInfo.setDifficulty(difficultyDropdown.value);
        }
        else
        {
            Debug.Log("Could Not Find Either Difficulty Dropdown Object Or The Settings Info Object");
            settingsInfo.setDifficulty(0);
        }

        // store level size settings
        if (levelSizeDropdown != null && settingsInfo != null)
        {
            settingsInfo.setLevelSize(levelSizeDropdown.value);
        }
        else
        {
            Debug.Log("Could Not Find Either Level Size Dropdown Object Or The Settings Info Object");
            settingsInfo.setLevelSize(0);
        }

        // store moving wall settings
        if (movingWallsToggle != null && settingsInfo != null)
        {
            settingsInfo.setMovingWalls(movingWallsToggle.isOn);
        }
        else
        {
            Debug.Log("Could Not Find Either Moving Walls Object Or The Settings Info Object");
            settingsInfo.setMovingWalls(false);
        }


        SceneManager.LoadSceneAsync(startScene);         // could assign a variable to this if necessary

        scene = SceneManager.GetSceneByName(startScene);

        Debug.Log(scene.name);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(this);         // want to keep this between scenes

        pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
        if (pss == null)
        {
            Instantiate(playersScoresObj);
            Debug.Log("Instantiated PlayerScoresObj");
            pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
        }

        // set defaults
        difficulty  = 0;
        levelSize   = 0;
        movingWalls = false;
    }
Exemplo n.º 3
0
    /// <summary>
    /// Allows this class to access the UI elements that are holding the current gamemode combination.
    /// Needs to be called at some point after they exist and before this class tries to access them.
    /// </summary>
    private void InitAccess()
    {
        if (difficultyDropdown == null)
        {
            difficultyDropdown = UIHelp.getAccessTo <Dropdown>("HsDifficulty");
        }

        if (levelSizeDropdown == null)
        {
            levelSizeDropdown = UIHelp.getAccessTo <Dropdown>("HsSize");
        }

        if (movingWallsToggle == null)
        {
            movingWallsToggle = UIHelp.getAccessTo <Toggle>("HsMoving");
        }

        if (scoresText == null)
        {
            scoresText = UIHelp.getAccessTo <Text>("ScoresText");
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
     TellScores();
 }
Exemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     pss = UIHelp.getAccessTo <PlayerScoresScript>("PlayerScores");
     pss.SetupStoredScores();
 }