This repository contains a collection of Unity scripts designed to enhance the development workflow by providing tools for object placement, transformation, visualization, and more. These scripts are particularly useful for level design, object management, and debugging in Unity projects.
This project includes the following scripts:
- CopyTransform: Duplicate GameObjects and set their transform data.
- SpawnPtGizmos: Visualize spawn points in the Unity Editor using gizmos.
- RotateObject: Rotate GameObjects based on specified rotation speeds.
- RandomTransformEditor: Create random transforms around a target GameObject.
- RandomGameObjectPlacer: Place GameObjects randomly at specified transforms.
- PickupsSpawner: Spawn and respawn pickups at random spawn points.
- FindObjectsByLayer: Select all GameObjects in the scene belonging to a specified layer.
- Clone this repository or download the ZIP file.
- Copy the scripts into your Unity project's
Assets
folder. - Attach the scripts to GameObjects or use them via the Unity Editor as described below.
Each script has a specific purpose and can be used independently. Refer to the Scripts Details section for detailed instructions on how to use each script.
- File: CopyTransform.cs
- Description: Duplicates a selected GameObject and sets the transform data for the duplicate and its children.
- Usage:
- Select a GameObject in the Unity Editor.
- Use the menu item
GameObject > SetPose
to duplicate and set the pose.
- File: SpawnPtGizmos.cs
- Description: Draws yellow gizmos in the Unity Editor to visualize spawn points.
- Usage: Attach this script to a GameObject to visualize its position with a cube in the Scene view.
- File: RotateObject.cs
- Description: Rotates a GameObject around its local axes based on a specified rotation speed.
- Usage: Attach this script to a GameObject and set the
rotationSpeed
in the Inspector.
- File: RandomTransformEditor.cs
- Description: Creates random transforms around a target GameObject.
- Usage:
- Open the custom editor via
Tools > Random Transform Creator
. - Configure the settings and click
Create Transforms
.
- Open the custom editor via
- File: RandomGameObjectPlacer.cs
- Description: Places GameObjects randomly at specified transforms.
- Usage:
- Attach this script to a GameObject.
- Configure the
targetTransforms
andgameObjectDataList
in the Inspector. - Use the
Place GameObjects
button in the Inspector.
- File: PickupsSpawner.cs
- Description: Spawns and respawns pickups at random spawn points.
- Usage:
- Attach this script to a GameObject.
- Configure the
spawnPoints
,prefab
,delay
, andamount
in the Inspector.
- File: FindObjectsByLayer.cs
- Description: Selects all GameObjects in the scene that belong to a specified layer.
- Usage:
- Open the custom editor via
Tools > Select Objects by Layer
. - Enter the layer name and click
Select Objects
.
- Open the custom editor via
This project is licensed under the MIT License. You are free to use, modify, and distribute the scripts as needed.