mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 03:32:47 +00:00
QSBPlayerLightSensor
This commit is contained in:
parent
017785929f
commit
5bda7e56e0
19
QSB/EchoesOfTheEye/LightSensorSync/QSBPlayerLightSensor.cs
Normal file
19
QSB/EchoesOfTheEye/LightSensorSync/QSBPlayerLightSensor.cs
Normal 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();
|
||||
}
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user