// Start is called before the first frame update
    void Start()
    {
        Random.InitState(SeedRandomGeneration.GetRandomSeed());

        objectParent = this.gameObject.transform.Find("AA Guns");
        lowestYpoint = GameObject.FindWithTag("Water").transform.position.y;
    }
示例#2
0
    //---------------------------------------------------------------

    // Start is called before the first frame update
    void Start()
    {
        Random.InitState(SeedRandomGeneration.GetRandomSeed());

        if (city)
        {
            buildingParent = this.gameObject.transform.Find("Buildings");
        }
        else
        {
            buildingParent = this.gameObject.transform.Find("Shrubery");
        }
        lowestYpoint = GameObject.FindWithTag("Water").transform.position.y;

        // calculate the weighted prob for buildings
        foreach (SpawnableObject buidling in buildings)
        {
            totalWeightedProbBuildings = buidling.CalculateWeightedSpawnProbability(totalWeightedProbBuildings);
        }

        foreach (SpawnableObject city in cityLayouts)
        {
            totalWeightedProbCities = city.CalculateWeightedSpawnProbability(totalWeightedProbCities);
        }
    }
示例#3
0
    private void Start()
    {
        Random.InitState(SeedRandomGeneration.GetRandomSeed());
        heightMapSettings.noiseSettings.seed = SeedRandomGeneration.GetRandomSeed();
        Debug.Log($"World Seed: {SeedRandomGeneration.GetRandomSeed()}");

        textureSettings.ApplyToMaterial(mapMaterial);
        textureSettings.UpdateMeshHeights(mapMaterial, heightMapSettings.minHeight, heightMapSettings.maxHeight);

        //mapGenerator = FindObjectOfType<MapGenerator>();

        float maxViewDistance = detailLevels[detailLevels.Length - 1].visibleDstThreshold;

        meshWorldSize = meshSettings.meshWorldSize;

        // spawn the chunks unorderly, needs to be islands for it to look good too
        if (randomGeneration && heightMapSettings.useFalloff)
        {
            UpdateVisibleChuncksRandomly();
        }
        // else if not random terrain generation, spawn the chunks as a grid
        else
        {
            UpdateVisibleChuncks(); // might not eval to true in update upon start
        }

        finishedTerrainSpawn = true;
    }
示例#4
0
 // Start is called before the first frame update
 void Awake()
 {
     buildingSpawner        = GameObject.FindWithTag("BuildingSpawner");
     playerTransform        = GameObject.FindWithTag("Player").GetComponent <Transform>();
     numberRemainingTargets = numberOfTargetBuildings;
     Random.InitState(SeedRandomGeneration.GetRandomSeed());
     buildingTargetingCompleted = false;
 }
示例#5
0
 // Start is called before the first frame update
 void Start()
 {
     // calculate the weighted prob
     foreach (SpawnableObject enemy in Enemies)
     {
         totalWeightedProb = enemy.CalculateWeightedSpawnProbability(totalWeightedProb);
     }
     Random.InitState(SeedRandomGeneration.GetRandomSeed());
 }
    // Start is called before the first frame update
    void Start()
    {
        Random.InitState(SeedRandomGeneration.GetRandomSeed());

        buildingParent = this.gameObject.transform.Find("Buildings");
        shruberyParent = this.gameObject.transform.Find("Shrubery");

        lowestYpoint = GameObject.FindWithTag("Water").transform.position.y;

        // calculate the weighted prob for buildings
        foreach (SpawnableObject buidling in buildings)
        {
            totalWeightedProbBuildings = buidling.CalculateWeightedSpawnProbability(totalWeightedProbBuildings);
        }

        // calculate the weighted prob for shrubery
        foreach (SpawnableObject plant in shrubery)
        {
            totalWeightedProbShrubery = plant.CalculateWeightedSpawnProbability(totalWeightedProbShrubery);
        }
    }
 // Start is called before the first frame update
 void Awake()
 {
     steamTanks = GameObject.FindObjectsOfType <TankController>();
     Random.InitState(SeedRandomGeneration.GetRandomSeed());
 }
示例#8
0
 // Start is called before the first frame update
 void Start()
 {
     gunParent = this.gameObject.transform.Find("AA Guns");
     Random.InitState(SeedRandomGeneration.GetRandomSeed());
 }
示例#9
0
    // Start is called before the first frame update
    void Awake()
    {
        mapSpawn     = GameObject.Find("MapGenerator");
        objectsSpawn = GameObject.Find("Buidling Spawner");

        // 1     Terrain
        // 2,3,4 Objects (buildings, plants, aaGuns)
        // 5     Enemies

        // enable the script in the game object one at a time
        // when it is done, trigger the next enable

        mapSpawn.GetComponent <IslandGenerator>().heightMapSettings.noiseSettings.seed = SeedRandomGeneration.GetRandomSeed();
    }