Skip to main content
Glama
TestGameObjectUtils.cs2.48 kB
/* ┌──────────────────────────────────────────────────────────────────┐ │ Author: Ivan Murzak (https://github.com/IvanMurzak) │ │ Repository: GitHub (https://github.com/IvanMurzak/Unity-MCP) │ │ Copyright (c) 2025 Ivan Murzak │ │ Licensed under the Apache License, Version 2.0. │ │ See the LICENSE file in the project root for more information. │ └──────────────────────────────────────────────────────────────────┘ */ #nullable enable using System.Collections; using com.IvanMurzak.Unity.MCP.Runtime.Utils; using NUnit.Framework; using UnityEngine; using UnityEngine.TestTools; namespace com.IvanMurzak.Unity.MCP.Editor.Tests { public partial class TestGameObjectUtils { [UnitySetUp] public IEnumerator SetUp() { Debug.Log($"[{nameof(TestGameObjectUtils)}] SetUp"); yield return null; } [UnityTearDown] public IEnumerator TearDown() { Debug.Log($"[{nameof(TestGameObjectUtils)}] TearDown"); yield return null; } [UnityTest] public IEnumerator FindByPath() { var parentName = "root"; var childName = "nestedGo"; new GameObject(parentName).AddChild(childName); var prefixes = new[] { "", "/" }; foreach (var prefix in prefixes) { Assert.IsNotNull(GameObjectUtils.FindByPath($"{prefix}{parentName}"), $"{prefix}{parentName} should not be null"); Assert.IsNotNull(GameObjectUtils.FindByPath($"{prefix}{parentName}/{childName}"), $"{prefix}{parentName}/{childName} should not be null"); } yield return null; } [UnityTest] public IEnumerator GetPath() { var parentName = "root"; var childName = "nestedGo"; var child = new GameObject(parentName).AddChild(childName); Assert.AreEqual(child.GetPath(), $"{parentName}/{childName}", $"GameObject '{childName}' should have path '{parentName}/{childName}'"); yield return null; } } }

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/IvanMurzak/Unity-MCP'

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