mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Use all cameras and rely on layers for culling
Also cleanup some stuff
This commit is contained in:
parent
1287e729eb
commit
d5038e19bc
@ -17,7 +17,7 @@ namespace ConformalDecals {
|
||||
|
||||
private readonly Renderer _targetRenderer;
|
||||
private readonly Mesh _targetMesh;
|
||||
private Boolean _projectionEnabled;
|
||||
private bool _projectionEnabled;
|
||||
|
||||
// property block
|
||||
public readonly MaterialPropertyBlock DecalMPB;
|
||||
@ -65,20 +65,12 @@ namespace ConformalDecals {
|
||||
|
||||
public bool Render(Material decalMaterial) {
|
||||
if (_projectionEnabled) {
|
||||
if (HighLogic.LoadedSceneIsEditor) {
|
||||
var camera = EditorLogic.fetch.editorCamera;
|
||||
foreach (var camera in Camera.allCameras) {
|
||||
Graphics.DrawMesh(_targetMesh, Target.worldToLocalMatrix, decalMaterial, 0, camera, 0, DecalMPB, ShadowCastingMode.Off, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (HighLogic.LoadedSceneIsFlight) {
|
||||
foreach (var camera in FlightCamera.fetch.cameras)
|
||||
{
|
||||
Graphics.DrawMesh(_targetMesh, Target.worldToLocalMatrix, decalMaterial, 0, camera, 0, DecalMPB, ShadowCastingMode.Off, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user