Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (startNeeded){
            if (currSystem != null){
                DestroyImmediate(currSystem);
            }

            currApocalypse = GameObject.Find("GameController").GetComponent<GameFlowController>().currentApocalypse.GetComponent<PolygonGenerator>().apocalypseType;
            Debug.Log("Current Apocalypse: " + currApocalypse.ToString());
            difficulty = GameObject.Find("EnemySpawner").GetComponent<EnemySpawn>().difficulty;
            Quaternion startRotation = Quaternion.LookRotation (new Vector3 (followDistance.x * -1 + 3, followDistance.y * -1 - 6, 0), new Vector3(0, 0, -1));

            switch (currApocalypse){
            case ApocalypseType.Desert:
                currSystem = Instantiate(sandstorm, transform.position + followDistance, startRotation) as ParticleSystem;
                editNeeded = true;
                break;
            case ApocalypseType.Volcano:
                currSystem = Instantiate(ash, transform.position + followDistance, startRotation) as ParticleSystem;
                break;
            default:
                currSystem = null;
                break;
            }

            if (currSystem != null){
                currSystem.enableEmission = true;
            }
            startNeeded = false;
        } else if (editNeeded){
            currSystem.startSpeed = 2 * difficulty+1;
            Debug.Log("Speed = " + currSystem.startSpeed.ToString());
            editNeeded = false;
        }
    }
Пример #2
0
 public void SetDifficulty()
 {
     terrain = (PolygonGenerator) GameObject.Find("GameController").GetComponent<GameFlowController>().currentApocalypse.GetComponent<PolygonGenerator>();
     currentApocalypse = terrain.apocalypseType;
     Debug.Log("Current Apocalypse: " + currentApocalypse.ToString());
     difficulty = GameObject.Find("EnemySpawner").GetComponent<EnemySpawn>().difficulty;
     //Debug.Log ("Difficulty: " + difficulty.ToString());
     maxHazards = difficulty * 5 + 5;
     hazardSpawnRate = 300 - (30 * difficulty);
     //Debug.Log("Spawn Rate: " + hazardSpawnRate.ToString());
 }
Пример #3
0
 protected virtual void SetType()
 {
     apocalypseType = (int)ApocalypseType.Default;
 }