added directional light object creation

main
Justin Barnett 2025-03-18 09:55:41 -04:00
parent 36b5b224b3
commit 3feecb09af
1 changed files with 14 additions and 0 deletions

View File

@ -46,6 +46,7 @@ namespace MCPServer.Editor.Commands
"EMPTY" => new GameObject(),
"CAMERA" => new GameObject("Camera") { }.AddComponent<Camera>().gameObject,
"LIGHT" => new GameObject("Light") { }.AddComponent<Light>().gameObject,
"DIRECTIONAL_LIGHT" => CreateDirectionalLight(),
_ => throw new System.Exception($"Unsupported object type: {type}")
};
@ -383,5 +384,18 @@ namespace MCPServer.Editor.Commands
.ToList()
};
}
/// <summary>
/// Creates a directional light game object
/// </summary>
private static GameObject CreateDirectionalLight()
{
var obj = new GameObject("DirectionalLight");
var light = obj.AddComponent<Light>();
light.type = LightType.Directional;
light.intensity = 1.0f;
light.shadows = LightShadows.Soft;
return obj;
}
}
}