Skip to main content

Stan Plugin User Guide (v1.0.4)

Welcome to the Stan Plugin User Guide! This document will walk you through installing, authenticating, and effectively using Stan, your AI co-pilot for Unity game development.


I. General & Overview

Stan is an AI-powered Unity Editor extension that acts as an intelligent co-pilot, capable of understanding your specific project context to automate scene construction, script generation, and asset management without you leaving the editor. Stan streamlines your workflow, allowing you to focus more on creative game design and less on repetitive coding tasks.

Compatibility

  • Minimum Unity Version: Unity 2022.3 (LTS)
  • Recommended Unity Version: Unity 2022.3.21f1 or newer (Unity 6 is also fully supported).

Prerequisites

  • An active internet connection (required for all AI processing and authentication).
  • A valid Unity Hub and Unity Editor installation.
  • Important Note: Unlike previous versions, Stan v1.0.4 does NOT require a local Node.js installation. All necessary runtime components are bundled directly into the plugin package.

II. Installation

Installing Stan v1.0.4 is a straightforward, "zero-setup" process designed for maximum ease of use.

Installation Steps

  1. Download the Package: Download the stan.unitypackage (v1.0.4) file from the official release page.
  2. Open Your Unity Project: Launch your Unity Editor and open the project where you intend to use Stan.
  3. Import Custom Package: In the Unity Editor's top menu, navigate to Assets > Import Package > Custom Package....
  4. Select Package: Browse to and select the downloaded stan.unitypackage file.
  5. Import Assets: A popup window will display a list of all assets included in the package. Click "Import" to bring all necessary files into your project.

Folder Structure

Upon successful import, the Stan plugin will reside entirely within the Assets/Stan/ directory in your Unity project.

  • Assets/Stan/Plugins/: Contains the secure, compiled DLLs (Dynamic Link Libraries) that form the core of Stan's AI logic.
  • Assets/Stan/MCPServer/: Houses the bundled standalone Message Control Protocol (MCP) server bridge.
  • Assets/Stan/Editor/: Contains editor-specific resources and scripts.

Post-Installation

  • First-Time Onboarding: Upon the very first installation of Stan in a project, a "Stan Onboarding" tutorial window should automatically appear, guiding you through initial setup and authentication.
  • Manual Opening: If the onboarding window does not appear, or if you close it, you can always manually open the main Stan Agent window via the Unity top menu: Window > Stan Agent.

III. Authentication (Modern "Device-Code" Flow)

Stan utilizes a secure, modern "Device Code" authentication flow, similar to how you might log into streaming services on smart TVs. Your credentials never touch the Unity Editor.

Initiating Login

  1. Open Stan Agent: Access the main Stan Agent window via Window > Stan Agent.
  2. Login Button: If you are not currently logged in, you will see a prominent "Login to Stan" button in the center of the window. Click this button to begin the authentication process.

UI Elements During Login

Once "Login to Stan" is clicked, the Stan Agent window will display critical information:

  • A URL to visit in your web browser.
  • A unique, alphanumeric Device Code.
  • A status indicator showing "⟳ Waiting for authentication...", indicating Stan is awaiting browser confirmation.
  • Convenience buttons to "Copy URL" or "Open in Browser".

Authentication URL

The "Open in Browser" button will direct you to the official Stan authentication portal. You will typically visit: https://stan.stanlink.online/#/auth?code={YOUR_DEVICE_CODE} (The {YOUR_DEVICE_CODE} part will be pre-filled with the code shown in your Unity Editor).

Successful Feedback

Once you authorize Stan in your web browser:

  • The Unity Stan Agent window will automatically refresh (no manual copy-pasting of keys is required).
  • A confirmation dialog box will appear in Unity: "Success: Successfully authenticated with Stan!".
  • The top toolbar of the Stan Agent window will update:
    • A green "🟢 MCP" indicator will confirm a successful connection to the Message Control Protocol server.
    • Your current token balance (for AI usage) will be displayed.

Session Management

  • Logout: To log out of Stan, simply click the "Logout" button located in the top-right toolbar of the Stan Agent window. This securely clears your authentication token from Unity's EditorPrefs.

IV. Core Features & Usage

A. Deep Project Context (The AI "Eyes")

Stan's unique ability lies in its deep contextual understanding of your Unity project, enabling highly relevant AI assistance.

  1. Enabling Context:

    • Deep Context is fully automatic. You do not need to manually trigger a "scan."
    • Every time you send a message or request to Stan, the StanContextGatherer runs silently in the background. It takes a real-time snapshot of your currently active scene hierarchy, active GameObjects, and relevant scripts before sending your prompt to the AI.
  2. Feedback Indicators:

    • While Stan is gathering context and processing your request, the "Send" button in the chat interface will change to an ellipsis ("...") and the input field will be temporarily disabled. This indicates that Stan is actively processing.
  3. Configuring Context:

    • In Stan v1.0.4, Deep Context gathering is an automated, "zero-config" process. It is designed to work out-of-the-box by intelligently scanning your active scene and common asset paths. Currently, there are no user-facing options to configure what Stan "sees," ensuring the AI always has the latest and most relevant state of your open scene.
  4. Example Prompt leveraging Deep Context:

    • Prompt: "Find the 'Player' GameObject in my scene and attach a new script called 'PlayerHealth.cs'. Make it handle damage events and update the UI slider named 'HealthBar' when health changes."
    • Stan's Understanding: Because of Deep Context, Stan knows if a GameObject named 'Player' exists, if a UI Slider named 'HealthBar' is present, and how to integrate with existing project structures, providing highly accurate and actionable results.

B. Task-Driven Workflow (Integrated Task Manager)

The integrated Task Manager provides transparency and control over Stan's actions, breaking down complex requests into manageable, trackable steps.

  1. Accessing Task Manager:

    • Open the Task Manager UI window via the Unity top menu: Stan > Task Manager.
  2. Task Stages/Statuses: The Task Manager displays tasks in distinct stages, each with a clear visual indicator:

    • Pending (Gray): The task is queued and awaiting processing.
    • InProgress (Blue): The task is currently being actively worked on by Stan.
    • Completed (Green): The task has been successfully finished.
  3. Task Information Displayed: Each entry in the Task Manager provides a summary of its current state:

    • Title: A bold, concise summary of the task's objective.
    • Status: The current stage (Pending, InProgress, Completed).
    • Priority: An indicator (High/Medium/Low) with corresponding color coding (Red/Yellow/Green) for easy identification.
    • Description: Detailed text explaining the task's requirements.
    • Estimated Time: An approximation of the time required for completion (e.g., "10 min").
  4. Interacting with Tasks: The Task Manager provides basic interaction to manage your workflow:

    • Start: Click "Start" on a Pending task to move it to the InProgress state.
    • Complete: Click "Complete" on an InProgress task to mark it as finished.
    • Refresh: A "Refresh Tasks" button allows you to fetch the latest state of tasks, especially if integrated with a backend project management flow.
    • Note: In v1.0.4, direct "Accept Changes" or "View Diff" for code modifications generated by tasks are primarily handled through Stan's chat output.
  5. Visual Indicators: The UI uses color-coded text for task statuses and priorities to provide quick visual cues, helping you to visualize the roadmap of AI-generated or manually added development steps.

C. AI Interaction

Interacting with Stan is designed to be intuitive and conversational, primarily through its chat interface.

  1. Input Interface:

    • All interactions with Stan occur within the Stan Agent window (Window > Stan Agent).
    • You will find a standard chat input text box at the bottom of this window where you type your requests.
  2. Prompting Best Practices:

    • Stan understands natural language. You can describe your needs in plain English.
    • Context is Key: To leverage Stan's Deep Project Context effectively, refer to specific GameObjects, script names, or asset names by their exact names as they appear in your Unity Hierarchy or Project window.
      • Example: Instead of "Create a cube," say "Create a Cube at position (0, 5, 0) and make it red." Even better: "Create a Cube in the 'Environment' GameObject and make its material red."
  3. Response Presentation: Stan communicates its progress and actions in several ways:

    • Chat Responses: Stan replies with text explanations, suggestions, or confirmations displayed in the chat view (typically left-aligned bubbles).
    • Action Confirmation: If Stan performs an action (e.g., creating a GameObject, modifying a script), a clear confirmation message will appear in the chat (e.g., "✅ Created GameObject: Cube").
    • Explainer Mode: If the "Explain" toggle (usually in the Stan Agent window toolbar) is active, Stan will provide detailed reasoning and step-by-step explanations for every change made or file created.

V. Troubleshooting & Support

Common Issues & Troubleshooting

  • "No Internet Connection" Error: Ensure your machine has an active internet connection. Check your firewall settings if you suspect network restrictions.
  • "Authentication Failed" / "Login Window Stuck":
    • Verify the device code was entered correctly in the browser.
    • Ensure your browser is logged into the correct StanLink account.
    • Try logging out and logging back in from the Stan Agent window.
  • "Stan Seems Stuck" / No Response:
    • Check the Unity Console for any error messages related to Stan.
    • Ensure you have an active internet connection.
    • Try restarting the Stan Agent window.
    • If persistent, try restarting Unity Editor.

Support

If you encounter issues not covered here, or require further assistance, please reach out to our support channels: