Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

3. Designing Tab

Halil Emre Yildiz edited this page Jan 13, 2024 · 13 revisions

The Designing tab contains the Generator, Object Spawner and Object Swapper tools that allow you to design a Terrain object.


Generator Tool

Generator is a tool that allows you to create a heightmap of a Terrain object using noise algorithms. This tool allows you to adjust the size, height and noise parameters of a Terrain object.

Usage

To use the Generator tool, follow these steps:

  1. Select the Designing tab and enable the Generator tool.
  2. Select or create a Terrain object that you want to generate.
  3. In the Base Settings section, adjust the basic properties of the Terrain object. The LiveGenerating option applies the changes instantly. The SaveHeightmap option saves the heightmap to the Assets/_JSG_DATA/Terrains/Generated folder. The TileSize option determines the size of the square tiles of the Terrain object in world units. The heightOffset option determines the constant value that is added to the height of the Terrain object in world units.
  4. In the Noise Settings section, adjust the parameters of the noise algorithm. The NoiseIntensity option determines the overall intensity of the noise (a value between 0 and 1). The NoiseHeight option determines the maximum height of the noise in world units. The NoiseScale option determines the scale of the noise (a positive value). The NoiseOctaves option determines the number of layers of noise (a positive integer). The NoiseLacunarity option determines the frequency increase rate of noise (a positive value). The NoisePersistence option determines the amplitude decrease rate of noise (a value between 0 and 1).
  5. Click on the Generate button to create the heightmap of the Terrain object.

Variables

The variables and UI elements of the Generator tool are as follows:

public Terrain Terrain; // The Terrain object that you want to generate
[Header("Base Settings")]
public bool LiveGenerating; // Check to apply the changes instantly
public bool SaveHeightmap; // Check to save the heightmap to Assets/_JSG_DATA/Terrains/Generated
public float TileSize = 5; // The size of the square tiles of the Terrain object in world units
public float heightOffset = 0; // The constant value that is added to the height of the Terrain object in world units
[Header("Noise Settings")]
public float NoiseIntensity = 0.25f; // The overall intensity of the noise (a value between 0 and 1)
public flaot NoiseHeight = 1; // The maximum height of the noise in world units
public float NoiseScale = 20; // The scale of the noise (a positive value)
public float NoiseOctaves = 3; // The number of layers of noise (a positive integer)
public float NoiseLacunarity = 2; // The frequency increase rate of noise (a positive value)
public float NoisePersistence = 0.5f; // The amplitude decrease rate of noise (a value between 0 and 1)
[Button("Generate")] Generate(Terrain, Path = "Assets/_JSG_DATA/Terrains/Generated"); // The Generate button, which creates the heightmap of the Terrain object and saves it to the specified folder

Object Spawner Tool

Object Spawner is a tool that allows you to spawn random objects in a certain area on the scene or on a Terrain object. This tool allows you to adjust the number, position, rotation and scale of objects.




Usage

To use Object Spawner tool, follow these steps:

  1. Select Designing tab and enable Object Spawner tool.
  2. Check Area Spawner option to visually adjust area that you want to spawn objects on. This area is determined by position, rotation and scale of Object Spawner object.
  3. In Area Options section, check SnapTerrainArea option to automatically align area with Terrain object.
  4. In Spawner Settings section, select prefab of object that you want to spawn. Count option determines number of objects that you want to spawn. AddTreeInstances option adds spawned objects as tree instances on Terrain object.
  5. In Transform Settings section, adjust position, rotation and scale of spawned objects. HeightPosition option determines height position of objects. InGizmo spawns objects anywhere in area, OnGizmo spawns objects at bottom of area, OnColliders spawns objects on colliders in area, OutColliders spawns objects out of colliders in area. Radius option determines radius of Collision method used for each object position. Contrast option determines number of vertical Collision methods used for each object position. LayerMask option scans only objects with selected layers. RandomRotation option makes objects have random rotation. xMin, xMax, yMin, yMax, zMin and zMax values determine rotation range of objects. RandomScale option makes objects have random scale. xMin, xMax, yMin, yMax, zMin and zMax values determine scale range of objects.
  6. Click on Spawn button to spawn random objects on scene or on Terrain object.

Variables

The variables and UI elements of Object Spawner tool are as follows:

public bool AreaSpawner; // Check to visually adjust area that you want to spawn objects on
[Header("Area Options")]
public bool SnapTerrainArea; // Check to automatically align area with Terrain object
[Header("Spawner Settings")]
public GameObject Prefab; // Prefab of object that you want to spawn
public Int Count = 100; // Number of objects that you want to spawn
public bool AddTreeInstances; // Check to add spawned objects as tree instances on Terrain object
[Header("Transform Settings")]
public HeightPositionFlag HeightPosition = OnColliders; // Option that determines height position of objects. InGizmo = Spawns objects anywhere in area, OnGizmo = Spawns objects at bottom of area, OnColliders = Spawns objects on colliders in area, OutColliders = Spawns objects out of colliders in area
[Range(0.025f, 1f)] public float Radius = 0.05; // Radius of Collision method used for each object position
[Range(100, 10000)] public int Contrast = 2500; // Number of vertical Collision  methods used for each object position
public LayerMask LayerMask = Mixed; // Scans only objects with selected layers
public bool RandomRotation; // Check to make objects have random rotation
public float xMin, xMax, yMin, yMax, zMin, zMax; // Rotation range of objects
public bool RandomScale; // Check to make objects have random scale
public float xMin, xMax, yMin, yMax, zMin, zMax; // Scale range of objects
[Button("Spawn")] SpawnObjects(); // The Spawn button, which spawns random objects on scene or on Terrain object

Object Swapper Tool

Object Swapper is a tool that allows you to swap objects in the scene or on a Terrain object with other objects. This tool allows you to select the source and target objects and change their positions.




Usage

To use Object Swapper tool, follow these steps:

  1. Select Designing tab and enable Object Swapper tool.
  2. In Scene Object Swapper section, check SceneObjectSwapper option to swap scene objects.
  3. Select source and target objects that you want to swap.
  4. Check GroupOldObjects option to group old objects under a parent object.
  5. Check AttachToOldObjects option to attach new objects to old objects as children.
  6. Check SortObjects option to sort new objects by name.
  7. Check ChangeTransforms option to change position and rotation of new objects.
  8. Adjust AddPosition and AddRotation values as you wish. These values determine the offset that is added to the position and rotation of new objects.
  9. Check KeepOldScale option to keep scale of old objects for new objects.
  10. Click on Swap button to swap scene objects.
  11. In Terrain Instance Swapper section, check TerrainInstanceSwapper option to swap Terrain instances.
  12. Select Terrain object that contains instances that you want to swap.
  13. Select source prototype that you want to swap from SourcePrototype dropdown menu.
  14. Select target object that you want to swap with from NewObjects dropdown menu.
  15. Check ChangeTransforms option to change position of new objects.
  16. Adjust addPosition value as you wish. This value determines the offset that is added to the position of new objects.
  17. Click on Swap button to swap Terrain instances.

Variables (old)

The variables and UI elements of Object Swapper tool are as follows:

[Header("Scene Object Swapper")]
public bool SceneObjectSwapper = true; // Check to swap scene objects
public GameObject[] SourceObjects; // Source objects that you want to swap
public GameObject NewObjects; // Target object that you want to swap with
public bool GroupOldObjects, AttachToOldObjects; // Check to group old objects under a parent object or attach new objects to old objects as children
public bool SortObjects; // Check to sort new objects by name
public bool ChangeTransforms; // Check to change position and rotation of new objects
public Vector3 AddPosition, AddRotation; // Offset that is added to the position and rotation of new objects
public bool KeepOldScale; // Check to keep scale

Clone this wiki locally