{"id":28324370,"url":"https://github.com/hardcodedev777/unitycodelama","last_synced_at":"2026-05-08T00:43:59.723Z","repository":{"id":293442785,"uuid":"981310654","full_name":"HardCodeDev777/UnityCodeLama","owner":"HardCodeDev777","description":"Unity Edtior tool to analyze your scripts via Ollama","archived":false,"fork":false,"pushed_at":"2025-05-22T16:04:11.000Z","size":2136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T03:19:45.392Z","etag":null,"topics":["csharp","ollama","unity","unity-editor","unity-package","unity-scripts"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HardCodeDev777.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-10T20:14:33.000Z","updated_at":"2025-05-22T16:04:14.000Z","dependencies_parsed_at":"2025-05-15T23:30:46.389Z","dependency_job_id":null,"html_url":"https://github.com/HardCodeDev777/UnityCodeLama","commit_stats":null,"previous_names":["hardcodedev777/unitycodelama"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HardCodeDev777/UnityCodeLama","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HardCodeDev777%2FUnityCodeLama","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HardCodeDev777%2FUnityCodeLama/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HardCodeDev777%2FUnityCodeLama/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HardCodeDev777%2FUnityCodeLama/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HardCodeDev777","download_url":"https://codeload.github.com/HardCodeDev777/UnityCodeLama/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HardCodeDev777%2FUnityCodeLama/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260194786,"owners_count":22972640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","ollama","unity","unity-editor","unity-package","unity-scripts"],"created_at":"2025-05-25T18:10:40.645Z","updated_at":"2026-05-08T00:43:59.717Z","avatar_url":"https://github.com/HardCodeDev777.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Ollama](https://img.shields.io/badge/Ollama-%23000000?logo=Ollama)\n![Unity](https://img.shields.io/badge/Unity-unity?logo=Unity\u0026color=%23000000)\n![C#](https://img.shields.io/badge/C%23-%23512BD4?logo=.NET)\n![License](https://img.shields.io/github/license/HardCodeDev777/UnityCodeLama?color=%2305991d)\n![Last commit](https://img.shields.io/github/last-commit/HardCodeDev777/UnityCodeLama?color=%2305991d)\n![Tag](https://img.shields.io/github/v/tag/HardCodeDev777/UnityCodeLama)\n![Top lang](https://img.shields.io/github/languages/top/HardCodeDev777/UnityCodeLama)\n\n # 🦙 UnityCodeLama — Unity Editor Tool\n\nListed in [Ollama Community Integrations](https://github.com/ollama/ollama?tab=readme-ov-file#community-integrations)\n\n\u0026nbsp;\n\n\n\u003e 🔍 Analyze your Unity scripts using large language models directly from the Editor — powered by [Ollama](https://ollama.com).\n\n---\n\n## 🚀 Overview\n\n**UnityCodeLama** is a powerful editor extension for Unity that allows you to send your C# scripts and prompts to an LLM (e.g. Qwen, Gemini, Deepseek, etc.) via Ollama — without ever leaving the editor.\n\nIt's useful for:\n- 🔍 Code explanations\n- 🐛 Bug hunting\n- ✨ Suggestions \u0026 improvements\n\n---\n\n## 📦 Installation\n\n1. Download the latest .unitypackage file from the Releases page.\n2. Drag \u0026 drop it into your Unity project window.\n3. Unity will automatically compile the editor extension.  \n\nNo additional setup required.\n\nThe `Plugins` folder includes several `.dll` files required for integration. \n\n---\n\n## 💻 Usage\n\nOpen the tool from the Unity menu:  \n`HardCodeDev → UnityCodeLama`\n\nOnce opened, you’ll see the following window:\n\n\u003cimg src=\"UtilityWindow.gif\" height=\"400\"\u003e\n\n---\n\n## 🧰 Editor Window Features\n\n### 📄 Scripts\n\n| Setting               | Description |\n|------------------------|-------------|\n| **Add script path**    | Adds a new object field in the window to select a script. |\n| **Script file**        | Drag \u0026 drop or select a `.cs` file to include. |\n| **Add script to prompt** | Adds the selected script to the prompt queue. |\n| **Clear script list**  | Removes all scripts from the queue. |\n\n---\n\n### ⚙️ Properties\n\n| Setting            | Description |\n|--------------------|-------------|\n| **Model name**     | Name of the Ollama model to use (e.g. `qwen2.5:3b`). |\n| **Clear \u003cthink\u003e**  | Removes `\u003cthink\u003e` blocks from models that produce internal thoughts (for cleaner output). |\n| **Prompt profile** | Selects the type of analysis to perform (Explain, Find bugs, Improve). |\n\n\u003cimg src=\"UtilityWindowWithProperties.png\" height=\"400\"\u003e\n\n---\n\n### 💬 Prompt\n\n| Setting             | Description |\n|---------------------|-------------|\n| **Prompt**          | The custom message to send to the model (e.g. questions, requests). |\n| **Send to Ollama**  | Sends your prompt, script(s), and profile to Ollama. |\n\nSee [How prompts are sent](#how-prompts-are-sent) for more details.\n\n---\n\n### 🤖 Response\n\n| Setting             | Description |\n|---------------------|-------------|\n| **Response**        | The LLM-generated reply (read-only). |\n| **Copy response**   | Copies the reply to your clipboard. |\n| **Clear response**  | Clears the response field. |\n\n---\n\n\u003e [!NOTE]\n\u003e This is an **Editor-only tool**. It works entirely within Unity Editor and doesn't affect runtime or builds.\n\n---\n\n## 📤 How Prompts Are Sent\n\nSay you have a script like:\n\n```csharp\nusing UnityEngine;\n\nnamespace HardCodeDev.Examples\n{\n    public class Test : MonoBehaviour\n    {\n        private int _count;\n        private void Count() =\u003e _count++;\n    }\n}\n```\n\nYou write a prompt like:\n\n```\nI made this script in 10 seconds!\n```\n\nWith profile \"Explain\", the full message sent to the model will be:\n\n```\nExplain what this code does.\nI made this script in 10 seconds! Here's the script(s): \n\n// Script starts \nusing UnityEngine;\n\nnamespace HardCodeDev.Examples\n{\n    public class Test : MonoBehaviour\n    {\n        private int _count;\n        private void Count() =\u003e _count++;\n    }\n}\n// Script ends \n```\n\n---\n\n### ⚙️ Code Behind (Simplified)\n\n```csharp\nvar promptInstruction = _promptOptions[_selectedPromptIndex] switch\n{\n    \"Explain\" =\u003e \"Explain what this code does.\",\n    \"Find bugs\" =\u003e \"Find any bugs or potential issues in this code.\",\n    \"Improve\" =\u003e \"Suggest improvements to this code.\",\n    _ =\u003e \"\"\n};\n\nvar fullPrompt = $\"{promptInstruction}\n{_prompt} Here's the script(s): {scriptInfo}\";\n```\n\nThe scripts are read using:\n\n```csharp\nscriptInfo += ScriptReader.ReadScript(path);\n```\n\nWith `ScriptReader` defined as:\n\n```csharp\npublic static class ScriptReader\n{\n    public static string ReadScript(string relativePath)\n    {\n        if (relativePath.StartsWith(\"/\"))\n            relativePath = relativePath.Substring(1);\n\n        var fullPath = Path.Combine(Application.dataPath, relativePath);\n        var code = \"\\n// Script starts \\n\";\n        code += File.ReadAllText(fullPath);\n        code += \"\\n// Script ends \\n\";\n        return code;\n    }\n}\n```\n---\n\n## 🛠 TODO\n\n- [ ] Review which `.dll` files in the `Plugins` folder are actually required and remove the unnecessary ones.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License**.  \nSee the [LICENSE](LICENSE) file for full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardcodedev777%2Funitycodelama","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardcodedev777%2Funitycodelama","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardcodedev777%2Funitycodelama/lists"}