예제 #1
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        spawnPoints = new List <GameObject>();
        GameObject[] objects = GameObject.FindGameObjectsWithTag("SpawnPoint");

        for (int iter = 0; objects.Length > iter; iter++)
        {
            spawnPoints.Add(EnemySpawningScript.instance.gameObject.transform.GetChild(iter).gameObject);
        }

        level             = LevelCreator.instance.GetLevel();
        currentLevelLogic = null;
        spawnerState      = "START";
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        Time.timeScale = 1;

        bool showTutorial = SecurePlayerPrefs.GetInt(Constants.SHOW_TUTORIAL, 1, Constants.SECURE_PASS) == 1;
        if (showTutorial)
        {
            pauseGame();
            tutorialPanel.GetComponent<TutorialManager>().initializeTutorial(true);
        }

        movementSpeed = SecurePlayerPrefs.GetInt (Constants.PLAYER_SPEED, Constants.PLAYER_INITIAL_SPEED, Constants.SECURE_PASS);
        horizontalSpeedMax = SecurePlayerPrefs.GetInt (Constants.PLAYER_SIDESPEED, Constants.PLAYER_INITIAL_SIDESPEED, Constants.SECURE_PASS);
        horizontalSpeedIncrement = SecurePlayerPrefs.GetFloat (Constants.PLAYER_AGILITY, Constants.PLAYER_INITIAL_AGILITY, Constants.SECURE_PASS);
        luck = SecurePlayerPrefs.GetFloat (Constants.PLAYER_LUCK, Constants.PLAYER_INITIAL_LUCK, Constants.SECURE_PASS);

        boosters = SecurePlayerPrefs.GetInt (Constants.AVAILABLE_BOOSTERS, 10, Constants.SECURE_PASS);
        updateBoostersUi ();
        breakTackles = SecurePlayerPrefs.GetInt (Constants.AVAILABLE_BREAK_TACKLES, 10, Constants.SECURE_PASS);
        updateBreakTacklesUi ();

        lastPosition = transform.position;
        y = lastPosition.y;

        boostsUsed = SecurePlayerPrefs.GetInt(Constants.BOOSTS_USED, 0, Constants.SECURE_PASS);

        enemySpawner = FindObjectOfType<EnemySpawningScript> ();
        boostersSpawner = FindObjectOfType<BoostersSpawningScript> ();

        reactionsAudio = FindObjectOfType<CrowdSoundsScript> ();
    }