quantum-space-buddies/QSB/Tools/PlayerToolsManager.cs

42 lines
991 B
C#
Raw Normal View History

2021-12-14 22:53:53 +00:00
using QSB.Player;
using QSB.Tools.FlashlightTool;
2021-07-26 22:55:09 +01:00
using QSB.Tools.ProbeLauncherTool;
using QSB.Tools.SignalscopeTool;
using QSB.Tools.TranslatorTool;
using QSB.Utility;
using System;
using UnityEngine;
namespace QSB.Tools
{
2020-12-02 21:23:01 +00:00
public class PlayerToolsManager
{
2021-12-14 22:53:53 +00:00
public static void InitRemote(PlayerInfo player)
2020-12-02 21:23:01 +00:00
{
try
{
FlashlightCreator.CreateFlashlight(player);
SignalscopeCreator.CreateSignalscope(player);
ProbeLauncherCreator.CreateProbeLauncher(player);
TranslatorCreator.CreateTranslator(player);
}
catch (Exception ex)
{
DebugLog.ToConsole($"Error when trying to create tools : {ex}", OWML.Common.MessageType.Error);
}
2020-12-02 21:23:01 +00:00
}
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;
}
}
2020-12-14 21:20:53 +00:00
}
}