示例#1
0
    void SetupLevel(int difficulty)
    {
        difficultyLevel = difficulty;
        levelData       = ResourceManager.LoadChaseLevel(difficultyLevel);
        if (levelData == null)
        {
            PlaySessionManager.instance.CompleteDream(false, 0, 0, 0f);
            return;
        }
        player.speed = levelData.playerSpeed;
        goalPosition = new Vector2(
            goal.transform.position.x,
            goal.transform.position.z);
        originalPosition = new Vector2(
            player.transform.position.x,
            player.transform.position.z);
        originalDistance = Vector2.Distance(
            goalPosition,
            originalPosition);

        float   playerZ         = player.transform.position.z;
        float   wallSize        = doomWall.GetComponent <Renderer>().bounds.size.z / 2;
        Vector3 newDoomPosition = doomWall.transform.position;

        newDoomPosition.z           = playerZ - levelData.wallStartDistance;
        newDoomPosition.z          -= wallSize;
        doomWall.transform.position = newDoomPosition;
        doomWall.speed = levelData.wallSpeed;

        CountdownClock.InitializeAndStart(
            levelData.timerMinutes,
            levelData.timerSeconds);
    }
示例#2
0
    void SetupLevel()
    {
        // Skills.
        SkillData[] chosenSkills = PlayerPrefsManager.LoadPlayerSkills();
        uiSkillManager.InitializeAndEnable(chosenSkills);

        // Input.
        BattleClassType typeToUse = PlayerPrefsManager.LoadSelectedClass();

        playerClass = ResourceManager.LoadBattleClass(typeToUse);
        Debug.Log("class selected: " + playerClass.className);
        inputManager.InitializeAndMonitor(playerClass, chosenSkills);

        // Health.
        healthManager.InitializeStats(levelData.playerHp, playerClass.def);

        // Enemy.
        spawnManager.InitializeAndStartSpawning(
            levelData.typeToSpawn,
            levelData.respawnTime);

        // Clock.
        CountdownClock.InitializeAndStart(
            levelData.timerMinutes,
            levelData.timerSeconds);
    }
    void SetupLevel(int difficulty)
    {
        difficultyLevel = difficulty;
        levelData       = ResourceManager.LoadFallLevel(difficultyLevel);

        if (levelData == null)
        {
            PlaySessionManager.instance.CompleteDream(0, 0);
            return;
        }
        ClearRings();
        RingMovement.movementSpeed = levelData.ringMovementSpeed;
        player.transform.position  = new Vector3(-1f, 0f, 1f);

        // Generate Rings
        for (int i = 0; i < levelData.maxConcurrentRings; ++i)
        {
            AddRing();
        }

        CountdownClock.InitializeAndStart(
            levelData.timerMinutes,
            levelData.timerSeconds);
    }