added directional light object creation
parent
36b5b224b3
commit
3feecb09af
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue