A number of useful scripts for every things in unity! Work with sprites, user interface, physics and more!
Each script written to perform a specific action. We call them component unit (CU). Some parts are included in this pack:
- Application
- Audio
- Camera
- Conditions
- GameObject
- Input
- Rigidbody & Rigidbody2D
- SceneManager
- Screen
- ScreenCapture
- Sprite
- StoreData
- Time
- Timer
- Transform
- UI
- MonoEvents
- Color fader - sprite renderer - renderer - UI
and so on.
This code snippet can be used for 2D and 3D projects. Each component has a simple task that can be combined with other components to perform more complex tasks.
Use these pieces of code instead of writing code for some small tasks. Use them to build prototypes and speed things up. Put them together and do more complex tasks without the need for coding.
- Unity 2019.4.7 or later versions.
- NaughtyAttributes
- TextMesh Pro 2.0.1
- Post Processing 2.3.0
- First install
TextMesh Pro
andPost Processing
packages in Unity through Package Manager.MenuItem - Window - Package Manager
- Add
TextMesh Pro
sample scenes.
- Download a
source code
zip from releases. - Extract it.
- Copy the items in the
Assets
folder into theAssets
folder of your project. (Click replace files if necessary)
- Install NaughtyAttributes.
- Download
.unitypackage
file from releases. - Import it into your project.
To learn more about how these components work, check out the sample scenes. The following are a number of practical cases.
2D sprites and 3D objects:
Unity UI system:
The CU_MonoEvent_Collider
component is used to detect all types of collisions and triggers in 2D and 3D.
The CU_MonoEvent_Mouse
component is used to detect mouse events.
Enter - Exit - Down - Up - Over - Drag
The CU_Transform_SnapObj
component and CU_Transform_Dragable
are used to snap one object to a specific point.
The CU_GameObject_Instantiate
component is used to spawn game objects.
Ther CU_GameObject_Destroy
component is used to delete game objects or delete the children of a specific game object from the scene.
The CU_Input_GetKey component
is used to detect input keys.
The CU_Input_GetMouseButton
component is used to detect mouse inputs.
The CU_Transform_Sync component
is used to synchronize the transform properties (position, rotation, scale) of an object game.
The CU_Transform_LerpPositions
component is used to move an agent between multiple points. This component also has a loop capability.
The CU_Transform_Dragable
component is used to enable the ability to drag objects.
The CU_Transform_Position_SyncToMouse
is used to synchronize the position of an object game with mouse.
The CU_Transform_Translate
component is used to move an object game on the screen.
The CU_Transform_LerpRotation
component is used to change the angle of a game object from one angle to another smoothly.
The CU_Transform_LookAt
component is used to look from one object to another.