Skip to content

billythekidz/UnityAntigravityIDE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

97 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Antigravity Unity IDE Support

Open VSX Version Open VSX Downloads Open VSX Rating GitHub Release License: MIT

Support me on Ko-fi

Full-featured Unity integration for Antigravity IDE β€” IntelliSense, debugging, Roslyn analyzers, and optimized project generation.

✨ Features

🎯 Smart Project Generation

  • Optimized for speed: Only generates .csproj for user-editable assemblies (Assets/ + local Packages/), skipping read-only package internals. Typical Unity projects drop from ~155 to ~10-15 project files.
  • Auto-cleanup: Removes orphaned .csproj and competing .slnx files automatically
  • DotRush-compatible references: Emits both <Reference> with <HintPath> (for Roslyn type resolution) and <ProjectReference> (for IDE navigation)
  • Response file support: Parses .rsp files for defines, references, and unsafe flags
  • Non-script assets: Includes .uxml, .uss, .shader, .asmdef as <None> items for navigation

🧠 C# IntelliSense (via DotRush)

  • Full IntelliSense, autocomplete, and error checking powered by Roslyn
  • Supports all Unity assemblies including UnityEngine.UI, TextMeshPro, etc.
  • Fast startup: filtered solution loads in seconds, not minutes
  • Auto-install: prompts to install DotRush on first activation if not present

🎨 Syntax Highlighting

  • ShaderLab (.shader)
  • HLSL/CG (.cginc, .hlsl, .cg, .compute)
  • USS β€” Unity Style Sheets (.uss)
  • UXML β€” Unity XML (.uxml)
  • Assembly Definitions (.asmdef, .asmref)

πŸ”§ Unity Project Tools

  • Antigravity: Regenerate Project Files β€” regenerate all .csproj and .sln from Unity
  • Antigravity: Attach Unity Debugger β€” attach to running Unity instance (experimental)
  • Antigravity: Unity API Reference β€” quick access to Unity docs
  • Unity C# code snippets (MonoBehaviour methods, attributes, etc.)

πŸ“¦ Installation

Unity Package (required)

Add to your Unity project's Packages/manifest.json:

{
  "dependencies": {
    "com.antigravity.ide": "https://github.com/billythekidz/UnityAntigravityIDE.git"
  }
}

Or use Unity Package Manager β†’ Add package from git URL:

https://github.com/billythekidz/UnityAntigravityIDE.git

1. Antigravity Unity IDE Extension

The extension provides Unity debugger, syntax highlighting for shaders, and deep IDE integration.

  • Option A (Marketplace): Search for "Antigravity Unity" in the Extensions Marketplace (or Open VSX) and install.
  • Option B (Manual VSIX): Download the latest .vsix from our GitHub Releases and install via Extensions: Install from VSIX....

2. DotRush (Mandatory for IntelliSense)

DotRush is REQUIRED for C# IntelliSense and debugging.

  • Marketplace: Search for "DotRush" or install nromanov.dotrush.
  • Manual install: Download from Open VSX if using an offline environment.

Installation Guide


πŸš€ Quick Start

  1. Install the Unity package (see above)
  2. Open your Unity project in Antigravity IDE
  3. Install DotRush when prompted (or manually)
  4. In Unity Editor: Edit β†’ Preferences β†’ External Tools β†’ External Script Editor β†’ Antigravity IDE
  5. Click "Regenerate project files" in the Antigravity IDE preferences panel
  6. Done! IntelliSense, debugging, and syntax highlighting are ready.
Support me on Ko-fi

⚑ Performance

Before (standard approach)

  • ~155 .csproj files for a typical Unity project
  • Roslyn loads ALL assemblies including read-only packages
  • Load time: 30-60 seconds

After (Antigravity optimized)

  • ~10-15 .csproj files (user-editable only)
  • Package types resolved via DLL HintPaths (no source parsing needed)
  • Load time: 2-5 seconds ⚑

πŸ—οΈ Architecture

UnityAntigravityIDE/
β”œβ”€β”€ Editor/                          # Unity Editor scripts (the UPM package)
β”‚   β”œβ”€β”€ AntigravityScriptEditor.cs   # IDE integration, preferences UI
β”‚   β”œβ”€β”€ ProjectGeneration.cs         # .csproj/.sln generation engine
β”‚   β”œβ”€β”€ UnityAnalyzerConfig.cs       # Roslyn analyzer configuration
β”‚   └── UnityDebugBridge.cs          # Debug bridge for Unity
β”œβ”€β”€ package.json                     # UPM package manifest
β”œβ”€β”€ .githooks/                       # Local git hooks
β”‚   └── pre-commit                   # Auto-increment patch version on commit
β”œβ”€β”€ antigravity-unity-extension~/    # VS Code extension (local dev only)
β”‚   └── release-extension.py         # Cross-platform release automator
β”œβ”€β”€ DotRush~/                        # DotRush reference (local dev only)
β”œβ”€β”€ com.unity.ide.vscode~/           # VS Code IDE reference (local dev only)
└── vscode-unity-debug~/             # Unity debugger reference (local dev only)

Note: Folders ending with ~ are ignored by Unity Package Manager and are not tracked in git (dev-only references).


πŸ”§ Configuration

.vscode/settings.json (auto-generated)

{
  "dotnet.defaultSolution": "YourProject.sln",
  "dotrush.roslyn.projectOrSolutionFiles": ["path/to/YourProject.sln"],
  "dotrush.msbuildProperties": {
    "DefineConstants": "UNITY_EDITOR"
  }
}

Unity Preferences

  • External Script Editor: Antigravity IDE
  • Editor arguments: customizable in preferences
  • Generate .csproj: automatic on script/asset changes

πŸ“ Versioning

Version is auto-incremented via a local git pre-commit hook:

  • Patch bumps on every commit (e.g., 2.1.7 β†’ 2.1.8)
  • Uses .githooks/pre-commit (cross-platform bash, works on macOS and Linux)
  • Set up: git config core.hooksPath .githooks

❓ FAQ / Troubleshooting

IntelliSense not working β€” no autocomplete or suggestions

This is the most common issue. Check these in order:

Check Fix
DotRush not installed Install nromanov.dotrush from Extensions or Open VSX
Antigravity Unity extension not installed Install from Marketplace or GitHub Releases
Wrong solution file selected When DotRush prompts, pick the .sln file β€” not .csproj or .slnx
No .sln file exists In Unity: Edit β†’ Preferences β†’ External Tools β†’ Regenerate project files
DotRush not activated Check Extensions panel β€” it must be enabled, not just installed

After fixing, run Ctrl+Shift+P β†’ Developer: Reload Window.

Special characters in folder/project names (&, +, #, etc.)

If any folder in your Unity project path contains special characters like &, +, #, or non-ASCII characters, DotRush/Roslyn may fail to parse .csproj files. Rename the folder to use only alphanumeric characters, dashes, and underscores.

"Why can't I just install Microsoft's C# extension?"

Microsoft's C#, C# Dev Kit, and Unity extensions are licensed exclusively for Visual Studio Code. They cannot be installed on Antigravity IDE, VSCodium, or any other VS Code fork. This is a Microsoft licensing policy, not a bug.

Our solution: DotRush β€” an open-source, MIT-licensed C# language server built on Roslyn that provides the same core IntelliSense features.

"Antigravity (internal)" shows in Unity instead of the real editor

Cause: Your Unity project has compile errors in C# scripts. When scripts fail to compile, Unity cannot load the Antigravity package properly, so it falls back to showing "(internal)".

Fix:

  1. Open Unity's Console window and look for red error messages.
  2. Fix all C# compilation errors in your project.
  3. Once scripts compile successfully, go to Edit β†’ Preferences β†’ External Tools β€” the dropdown should now show "Antigravity" (not "internal").

Tip: Common culprits include [SerializeField] on auto-properties (not supported on some Unity versions), missing assembly references, or outdated third-party packages.

Antigravity IDE is not listed in Unity's External Script Editor dropdown

Cause Fix
Antigravity IDE is not installed Install from Antigravity Downloads or your package manager
App is not in /Applications/ (macOS) Move Antigravity.app to /Applications/
Unity package not installed Add the git URL to Packages/manifest.json (see Installation)
Project has compile errors Fix all C# errors first (see above)

DotRush IntelliSense is not working

  1. Confirm DotRush is installed: open Extensions in Antigravity IDE and search for nromanov.dotrush.
  2. In Unity: Edit β†’ Preferences β†’ External Tools β†’ Regenerate project files.
  3. Make sure .vscode/settings.json contains "dotnet.defaultSolution" pointing to your .sln.
  4. Restart Antigravity IDE after regenerating project files.

Windows: .NET SDK not found or dotnet command errors

DotRush requires the .NET SDK to be installed and accessible:

  1. Download from dotnet.microsoft.com (SDK, not just Runtime).
  2. After installation, restart Antigravity IDE (not just reload window).
  3. Verify in terminal: dotnet --version should return a version number.
  4. If dotnet is still not found, add it to your PATH manually: C:\Program Files\dotnet\

Windows: Long path errors (MAX_PATH exceeded)

Unity projects nested deep in folders can hit Windows' 260-character path limit:

  1. Open Registry Editor β†’ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  2. Set LongPathsEnabled to 1
  3. Or run in an elevated PowerShell:
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
  4. Restart your machine.

Windows: Firewall or proxy blocks extension downloads

Some corporate/school environments block Open VSX or GitHub:

  • Download .vsix files manually from Open VSX or GitHub Releases.
  • Install via Ctrl+Shift+P β†’ Extensions: Install from VSIX....

Windows: Unable to watch for file changes error

Unity projects generate thousands of files in Library/ and Temp/. Add these exclusions to your workspace settings:

{
  "files.watcherExclude": {
    "**/Library/**": true,
    "**/Temp/**": true,
    "**/obj/**": true
  }
}

Windows: Antivirus flags DotRush or the extension

Some antivirus software (especially Windows Defender) may quarantine DotRush's language server binary. Add an exclusion for your Antigravity IDE installation folder and the .dotnet tools directory.

macOS: "open" command errors or editor doesn't launch

  • Ensure Antigravity.app is in /Applications/ (not ~/Downloads/).
  • If Gatekeeper blocks the app, right-click β†’ Open to bypass.
  • The Unity package handles macOS .app bundles automatically β€” you don't need to point to the inner Contents/MacOS/ binary.

Debugging: "Cannot attach to Unity" or no instances found

  1. Make sure Unity Editor is running with your project open.
  2. In Antigravity IDE: Ctrl+Shift+P β†’ Antigravity: Attach Unity Debugger.
  3. If no instances appear, check that Unity's Script Debugging is enabled in Build Settings.
  4. On Windows, ensure your firewall isn't blocking the debugger port.

How do I set up the git hooks after cloning?

Run this once after cloning the repo:

git config core.hooksPath .githooks

This enables the pre-commit hook that auto-bumps the Unity package version.


πŸ“„ License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Sponsor this project

  •  

Packages