added directional light object creation
parent
36b5b224b3
commit
3feecb09af
|
|
@ -46,6 +46,7 @@ namespace MCPServer.Editor.Commands
|
||||||
"EMPTY" => new GameObject(),
|
"EMPTY" => new GameObject(),
|
||||||
"CAMERA" => new GameObject("Camera") { }.AddComponent<Camera>().gameObject,
|
"CAMERA" => new GameObject("Camera") { }.AddComponent<Camera>().gameObject,
|
||||||
"LIGHT" => new GameObject("Light") { }.AddComponent<Light>().gameObject,
|
"LIGHT" => new GameObject("Light") { }.AddComponent<Light>().gameObject,
|
||||||
|
"DIRECTIONAL_LIGHT" => CreateDirectionalLight(),
|
||||||
_ => throw new System.Exception($"Unsupported object type: {type}")
|
_ => throw new System.Exception($"Unsupported object type: {type}")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -383,5 +384,18 @@ namespace MCPServer.Editor.Commands
|
||||||
.ToList()
|
.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