QSBPlayerLightSensor

This commit is contained in:
JohnCorby 2022-05-28 13:42:19 -07:00
parent 017785929f
commit 5bda7e56e0
4 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using UnityEngine;
namespace QSB.EchoesOfTheEye.LightSensorSync;
[RequireComponent(typeof(LightSensor))]
public class QSBPlayerLightSensor : MonoBehaviour
{
private LightSensor _lightSensor;
private void Awake() => _lightSensor = GetComponent<LightSensor>();
internal bool _locallyIlluminated;
public Action OnDetectLocalLight;
public Action OnDetectLocalDarkness;
internal readonly List<uint> _illuminatedBy = new();
}

View File

@ -1,4 +1,5 @@
using OWML.Common;
using QSB.EchoesOfTheEye.LightSensorSync;
using QSB.Utility;
using UnityEngine;
@ -73,6 +74,8 @@ public partial class PlayerInfo
}
}
public QSBPlayerLightSensor PlayerLightSensor;
public Vector3 Velocity
{
get

View File

@ -1,4 +1,5 @@
using QSB.Messaging;
using QSB.EchoesOfTheEye.LightSensorSync;
using QSB.Messaging;
using QSB.Player;
using QSB.Player.Messages;
using QSB.SectorSync;
@ -37,6 +38,8 @@ public static class LocalPlayerCreation
player.CameraBody = cameraBody.gameObject;
visibleCameraRoot = cameraBody;
player.PlayerLightSensor = player.LightSensor.gameObject.GetAddComponent<QSBPlayerLightSensor>();
PlayerToolsManager.InitLocal();
// stick

View File

@ -1,4 +1,5 @@
using QSB.Audio;
using QSB.EchoesOfTheEye.LightSensorSync;
using QSB.Player;
using QSB.RoastingSync;
using QSB.Tools;
@ -76,6 +77,8 @@ public static class RemotePlayerCreation
player.CameraBody = REMOTE_PlayerCamera;
visibleCameraRoot = REMOTE_PlayerCamera.transform;
player.PlayerLightSensor = player.LightSensor.gameObject.GetAddComponent<QSBPlayerLightSensor>();
PlayerToolsManager.InitRemote(player);
/*