From 3feecb09af96f24ebdf56fe6060e5609fee31c43 Mon Sep 17 00:00:00 2001 From: Justin Barnett Date: Tue, 18 Mar 2025 09:55:41 -0400 Subject: [PATCH] added directional light object creation --- Editor/Commands/ObjectCommandHandler.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Editor/Commands/ObjectCommandHandler.cs b/Editor/Commands/ObjectCommandHandler.cs index 981e13c..2112b03 100644 --- a/Editor/Commands/ObjectCommandHandler.cs +++ b/Editor/Commands/ObjectCommandHandler.cs @@ -46,6 +46,7 @@ namespace MCPServer.Editor.Commands "EMPTY" => new GameObject(), "CAMERA" => new GameObject("Camera") { }.AddComponent().gameObject, "LIGHT" => new GameObject("Light") { }.AddComponent().gameObject, + "DIRECTIONAL_LIGHT" => CreateDirectionalLight(), _ => throw new System.Exception($"Unsupported object type: {type}") }; @@ -383,5 +384,18 @@ namespace MCPServer.Editor.Commands .ToList() }; } + + /// + /// Creates a directional light game object + /// + private static GameObject CreateDirectionalLight() + { + var obj = new GameObject("DirectionalLight"); + var light = obj.AddComponent(); + light.type = LightType.Directional; + light.intensity = 1.0f; + light.shadows = LightShadows.Soft; + return obj; + } } } \ No newline at end of file