Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
234 changes: 66 additions & 168 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,190 +1,88 @@
<h1 align="center"><a href="https://github.com/IvanMurzak/Unity-AI-Tools-Template">Unity AI Tools Template</a></h1>
<h1 align="center"><a href="https://github.com/IvanMurzak/Unity-AI-ParticleSystem?tab=readme-ov-file#unity-ai-particle-system">Unity AI Particle System</a></h1>

<img width="100%" alt="Stats" src="https://github.com/IvanMurzak/Unity-AI-Tools-Template/raw/main/docs/img/ai-template-glitch.gif"/>
<div align="center" width="100%">

Template for AI MCP Tools for [AI Game Developer (Unity-MCP)](https://github.com/IvanMurzak/Unity-MCP). Use this template to create your custom MCP tools for Unity Engine in 30 minutes. Read more about custom MCP tools [here](https://github.com/IvanMurzak/Unity-MCP?tab=readme-ov-file#add-custom-mcp-tool).
[![MCP](https://badge.mcpx.dev 'MCP Server')](https://modelcontextprotocol.io/introduction)
[![OpenUPM](https://img.shields.io/npm/v/com.ivanmurzak.unity.mcp.particlesystem?label=OpenUPM&registry_uri=https://package.openupm.com&labelColor=333A41 'OpenUPM package')](https://openupm.com/packages/com.ivanmurzak.unity.mcp.particlesystem/)
[![Unity Editor](https://img.shields.io/badge/Editor-X?style=flat&logo=unity&labelColor=333A41&color=2A2A2A 'Unity Editor supported')](https://unity.com/releases/editor/archive)
[![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg 'Tests Passed')](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml)</br>
[![Discord](https://img.shields.io/badge/Discord-Join-7289da?logo=discord&logoColor=white&labelColor=333A41 'Join')](https://discord.gg/cfbdMZX99G)
[![Stars](https://img.shields.io/github/stars/IvanMurzak/Unity-AI-ParticleSystem 'Stars')](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/stargazers)
[![License](https://img.shields.io/github/license/IvanMurzak/Unity-AI-ParticleSystem?label=License&labelColor=333A41)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/blob/main/LICENSE)
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)

This template repository is designed to be easily updated into a real Unity package. Please follow the instruction bellow, it will help you to go through the entire process of package creation, distribution and installing.
</div>

# Steps to make your package
<img width="100%" alt="Promo" src="https://github.com/IvanMurzak/Unity-AI-ParticleSystem/raw/main/docs/img/particle-system-glitch.gif"/>

#### 1️⃣ Click the button to create new repository on GitHub using this template.
AI-powered tools for Unity ParticleSystem workflow. Inspect and modify ParticleSystem components directly through natural language commands. Configure emission settings, shape modules, velocity curves, color gradients, and all 24 particle system modules without manual inspector navigation. Ideal for rapid prototyping, procedural effects generation, and streamlining complex particle setups. Built on top of the [AI Game Developer](https://github.com/IvanMurzak/Unity-MCP) platform.

[![create new repository](https://user-images.githubusercontent.com/9135028/198753285-3d3c9601-0711-43c7-a8f2-d40ec42393a2.png)](https://github.com/IvanMurzak/Unity-AI-Tools-Template/generate)
### How to use

#### 2️⃣ Clone your new repository and open it in Unity Editor
- [Instructions](https://github.com/IvanMurzak/Unity-MCP?tab=readme-ov-file#step-2-install-mcp-client)
- [Video Tutorial for Visual Studio Code](https://www.youtube.com/watch?v=ZhP7Ju91mOE)
- [Video Tutorial for Visual Studio](https://www.youtube.com/watch?v=RGdak4T69mc)

#### 3️⃣ Initialize Project
[![DOWNLOAD INSTALLER](https://github.com/IvanMurzak/Unity-MCP/blob/main/docs/img/button/button_download.svg?raw=true)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/releases/download/1.0.0/AI-ParticleSystem-Installer.unitypackage)

Use the initialization script to rename the package and replace all placeholders.
### Stability status

```powershell
.\commands\init.ps1 -PackageId "com.company.package" -PackageName "My Package"
```

This script will:
- Rename directories and files.
- Replace `com.IvanMurzak.Unity.MCP.ParticleSystem`, `AI Particle System`, etc. in all files.

#### 4️⃣ Manual Configuration

1. **Update `package.json`**
Open `Unity-Package/Assets/root/package.json` and update:
- `description`
- `author`
- `keywords`
- `unity` (minimum supported Unity version)

2. **Generate Meta Files**
To ensure all Unity meta files are correctly generated:
- Open Unity Hub.
- Add the `Installer` folder as a project.
- Add the `Unity-Package` folder as a project.
- Open both projects in Unity Editor. This will generate the necessary `.meta` files.

#### 5️⃣ Add MCP Tools

Decide what type of MCP tool you need:

- **MCP tool for Unity Editor**
- ✔️ Works in Unity Editor (Edit Mode)
- ✔️ Works in Unity Editor (Play Mode)
- ✔️ Has access to Editor API
- ❌ Available in a game build
- **MCP tool for Unity Runtime**
- ✔️ Works in Unity Editor (Edit Mode)
- ✔️ Works in Unity Editor (Play Mode)
- ❌ Has access to Editor API
- ✔️ Available in a game build

Based on your choice create script at the location

- Editor: `Unity-Package/Assets/root/Editor`
- Runtime: `Unity-Package/Assets/root/Runtime`

> Read detailed instructions about custom tool development [here](https://github.com/IvanMurzak/Unity-MCP?tab=readme-ov-file#add-custom-mcp-tool).

```csharp
[McpPluginToolType]
public static class MyCustomTool
{
[McpPluginTool("my-custom-feature", Title = "Do my custom feature")]
[Description("Put here the tool description for LLM.")]
public static Task<bool> DoTurn(
[Description("Add description to the input property, help LLM better understand it.)]
int figureId,
[Description("Add description to the input property, help LLM better understand it.)]
Vector2Int position)
{
// do any logic in background thread here
return MainThread.Instance.RunAsync(() =>
{
// do any logic in main thread here

return true;
});
}
}
```


---

## Optional improvements

Next steps are not required to make everything to work, but they could be a great improvement for your new package.

### Optional - Setup CI/CD

To enable automatic testing and deployment:

1. **Configure GitHub Secrets**
Go to `Settings` > `Secrets and variables` > `Actions` > `New repository secret` and add:
- `UNITY_EMAIL`: Your Unity account email.
- `UNITY_PASSWORD`: Your Unity account password.
- `UNITY_LICENSE`: Content of your `Unity_lic.ulf` file.
- Windows: `C:/ProgramData/Unity/Unity_lic.ulf`
- Mac: `/Library/Application Support/Unity/Unity_lic.ulf`
- Linux: `~/.local/share/unity3d/Unity/Unity_lic.ulf`

2. **Enable Workflows**
Rename the sample workflow files to enable them:
- `.github/workflows/release.yml-sample` ➡️ `.github/workflows/release.yml`
- `.github/workflows/test_pull_request.yml-sample` ➡️ `.github/workflows/test_pull_request.yml`

3. **Update Unity Version**
Open both `.yml` files and update the `UNITY_VERSION` (or similar variable) to match your project's Unity Editor version.

4. **Automatic Deployment**
The release workflow triggers automatically when you push to the `main` branch with an incremented version in `package.json`.

### Optional - Add files into `Assets/root` folder

[Unity guidelines](https://docs.unity3d.com/Manual/cus-layout.html) about organizing files into the package root directory

```text
<root>
├── package.json
├── README.md
├── CHANGELOG.md
├── LICENSE.md
├── Third Party Notices.md
├── Editor
│ ├── [company-name].[package-name].Editor.asmdef
│ └── EditorExample.cs
├── Runtime
│ ├── [company-name].[package-name].asmdef
│ └── RuntimeExample.cs
├── Tests
│ ├── Editor
│ │ ├── [company-name].[package-name].Editor.Tests.asmdef
│ │ └── EditorExampleTest.cs
│ └── Runtime
│ ├── [company-name].[package-name].Tests.asmdef
│ └── RuntimeExampleTest.cs
├── Samples~
│ ├── SampleFolder1
│ ├── SampleFolder2
│ └── ...
└── Documentation~
└── [package-name].md
```
| Unity Version | Editmode | Playmode | Standalone |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2022.3.62f3 | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2022-3-62f3-editmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2022-3-62f3-playmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2022-3-62f3-standalone)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) |
| 2023.2.22f1 | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2023-2-22f1-editmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2023-2-22f1-playmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-2023-2-22f1-standalone)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) |
| 6000.3.1f1 | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-6000-3-1f1-editmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-6000-3-1f1-playmode)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) | [![r](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/workflows/release/badge.svg?job=test-unity-6000-3-1f1-standalone)](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/actions/workflows/release.yml) |

#### 8️⃣ Optional - Version Management
## AI Particle System Tools

To update the package version across all files (package.json, Installer.cs, etc.), use the bump version script:
ParticleSystem tools:

```powershell
.\commands\bump-version.ps1 -NewVersion "1.0.1"
```

##### Final polishing

- Update the `README.md` file (this file) with information about your package.
- Copy the updated `README.md` to `Assets/root` as well.
- `particle-system-get` - Get ParticleSystem component data (state, modules, renderer settings)
- `particle-system-modify` - Modify ParticleSystem component (update any module properties)

> ⚠️ Everything outside of the `root` folder won't be added to your package. But still could be used for testing or showcasing your package at your repository.
Supported modules (24 total):

#### 9️⃣ Deploy to any registry you like
| Module | Description |
| ------ | ----------- |
| Main | Duration, looping, start lifetime, speed, size, rotation, color |
| Emission | Rate over time/distance, bursts |
| Shape | Emitter shape (sphere, cone, box, mesh, etc.) |
| Velocity Over Lifetime | Velocity changes over particle lifetime |
| Limit Velocity Over Lifetime | Speed limits and damping |
| Inherit Velocity | Velocity inheritance from emitter movement |
| Lifetime By Emitter Speed | Particle lifetime based on emitter speed |
| Force Over Lifetime | External forces applied to particles |
| Color Over Lifetime | Color gradient over particle lifetime |
| Color By Speed | Color based on particle speed |
| Size Over Lifetime | Size curve over particle lifetime |
| Size By Speed | Size based on particle speed |
| Rotation Over Lifetime | Angular velocity over lifetime |
| Rotation By Speed | Rotation based on particle speed |
| External Forces | Wind zone and force field influence |
| Noise | Turbulence and noise-based movement |
| Collision | World and plane collision |
| Trigger | Trigger zone interactions |
| Sub Emitters | Child particle systems on events |
| Texture Sheet Animation | Sprite sheet animation |
| Lights | Real-time lights attached to particles |
| Trails | Particle trail rendering |
| Custom Data | Custom per-particle data streams |
| Renderer | Material, render mode, sorting, shadows |

- [Deploy to OpenUPM](https://github.com/IvanMurzak/Unity-Package-Template/blob/main/Docs/Deploy-OpenUPM.md) (recommended)
- [Deploy using GitHub](https://github.com/IvanMurzak/Unity-Package-Template/blob/main/Docs/Deploy-GitHub.md)
- [Deploy to npmjs.com](https://github.com/IvanMurzak/Unity-Package-Template/blob/main/Docs/Deploy-npmjs.md)
## Installation

# Install your package into Unity Project
### Option 1 - Installer

When your package is distributed, you can install it into any Unity project.
- **[Download Installer](https://github.com/IvanMurzak/Unity-AI-ParticleSystem/releases/download/1.0.0/AI-ParticleSystem-Installer.unitypackage)**
- **Import installer into Unity project**
> - You can double-click on the file - Unity will open it automatically
> - OR: Open Unity Editor first, then click on `Assets/Import Package/Custom Package`, and choose the file

> Don't install into the same Unity project, please use another one.
### Option 2 - OpenUPM-CLI

- [Install OpenUPM-CLI](https://github.com/openupm/openupm-cli#installation)
- Open a command line at the root of Unity project (the folder which contains `Assets`)
- Execute the command (for `OpenUPM` hosted package)
- Open the command line in your Unity project folder

```bash
openupm add AI Particle System
```

# Final view in Unity Package Manager

![image](https://user-images.githubusercontent.com/9135028/198777922-fdb71949-aee7-49c8-800f-7db885de9453.png)
```bash
openupm add com.ivanmurzak.unity.mcp.particlesystem
```
22 changes: 13 additions & 9 deletions Unity-Package/Assets/Resources/AI-Game-Developer-Config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
{
"logLevel": 3,
"tools": [
{
"name": "particlesystem-get",
"enabled": true
},
{
"name": "particlesystem-modify",
"enabled": true
},
{
"name": "assets-copy",
"enabled": true
Expand All @@ -25,6 +17,10 @@
"name": "assets-find",
"enabled": true
},
{
"name": "assets-find-built-in",
"enabled": true
},
{
"name": "assets-get-data",
"enabled": true
Expand Down Expand Up @@ -204,6 +200,14 @@
{
"name": "tests-run",
"enabled": true
},
{
"name": "particle-system-get",
"enabled": true
},
{
"name": "particle-system-modify",
"enabled": true
}
],
"prompts": [
Expand Down Expand Up @@ -400,5 +404,5 @@
],
"host": "http://localhost:53451",
"timeoutMs": 10000,
"keepConnected": true
"keepConnected": false
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.API
{
public partial class Tool_ParticleSystem
{
public const string ParticleSystemGetToolId = "particlesystem-get";
public const string ParticleSystemGetToolId = "particle-system-get";

[McpPluginTool
(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace com.IvanMurzak.Unity.MCP.ParticleSystem.Editor.API
{
public partial class Tool_ParticleSystem
{
public const string ParticleSystemModifyToolId = "particlesystem-modify";
public const string ParticleSystemModifyToolId = "particle-system-modify";

[McpPluginTool
(
Expand Down
Loading
Loading