always have local flashlight casting shadows

This commit is contained in:
Mister_Nebula 2021-11-25 11:28:13 +00:00
parent 225f0254f6
commit 73e8f498a2
2 changed files with 17 additions and 3 deletions

View File

@ -101,6 +101,8 @@ namespace QSB.Player.TransformSync
Player.CameraBody = cameraBody.gameObject;
_visibleCameraRoot = cameraBody;
PlayerToolsManager.InitLocal();
// stick
var pivot = GetStickPivot();
Player.RoastingStick = pivot.parent.gameObject;
@ -163,7 +165,7 @@ namespace QSB.Player.TransformSync
* SET UP PLAYER CAMERA
*/
PlayerToolsManager.Init(REMOTE_PlayerCamera.transform);
PlayerToolsManager.InitRemote(REMOTE_PlayerCamera.transform);
var camera = REMOTE_PlayerCamera.AddComponent<Camera>();
camera.enabled = false;

View File

@ -19,7 +19,7 @@ namespace QSB.Tools
public static Material Props_HEA_Lightbulb_OFF_mat;
public static Material Structure_HEA_PlayerShip_Screens_mat;
public static void Init(Transform playerCamera)
public static void InitRemote(Transform playerCamera)
{
try
{
@ -42,7 +42,6 @@ namespace QSB.Tools
Props_HEA_Lightbulb_OFF_mat = null;
Structure_HEA_PlayerShip_Screens_mat = null;
}
}
catch (Exception ex)
{
@ -55,6 +54,19 @@ namespace QSB.Tools
TranslatorCreator.CreateTranslator(playerCamera);
}
public static void InitLocal()
{
var flashlight = Locator.GetFlashlight();
var spot = flashlight._illuminationCheckLight;
var lightLOD = spot.GetComponent<LightLOD>();
if (lightLOD != null)
{
UnityEngine.Object.Destroy(lightLOD);
spot.GetLight().shadows = LightShadows.Soft;
}
}
private static void CreateStowTransforms(Transform cameraBody)
{
var stow = new GameObject("REMOTE_ToolStowTransform");