Skip to main content
Glama
SceneOperationsService.ts1.87 kB
import { ITransport } from '../../transports/index.js'; import { BaseService } from './BaseService.js'; export interface LoadSceneParams { index?: number; sceneName?: string; } export interface SaveSceneParams { saveAll?: boolean; } export interface CreateSceneParams { sceneName?: string; } export interface FindInSceneParams { tag?: string; pattern?: string; componentType?: string; } export interface CleanupSceneParams { removeMissingScripts?: boolean; removeEmpty?: boolean; } /** * Service for Unity scene operations and hierarchy management * Provides scene navigation, object finding, and batch operations * Supports both HTTP and WebSocket transports */ export class SceneOperationsService extends BaseService { constructor(transport: ITransport) { super(transport); } /** * List all scenes in build settings */ async listScenes() { return this.post('/scene/list', {}); } /** * Load a scene */ async loadScene(params: LoadSceneParams) { return this.post('/scene/load', params); } /** * Save current or all scenes */ async saveScene(params: SaveSceneParams = {}) { return this.post('/scene/save', params); } /** * Create a new scene */ async createNewScene(params: CreateSceneParams = {}) { return this.post('/scene/new', params); } /** * Get scene hierarchy */ async getHierarchy() { return this.post('/scene/hierarchy', {}); } /** * Find objects in current scene */ async findInScene(params: FindInSceneParams) { return this.post('/scene/find', params); } /** * Clean up scene (remove missing scripts, empty objects, etc.) */ async cleanupScene(params: CleanupSceneParams) { return this.post('/scene/cleanup', params); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muammar-yacoob/unity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server