mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-10 03:40:01 +00:00
add QSBProbeSpotlight
This commit is contained in:
parent
dfdad2661d
commit
fedf89e045
@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.ProbeSync
|
||||
@ -19,6 +16,7 @@ namespace QSB.ProbeSync
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
DebugLog.DebugWrite("Awake");
|
||||
_probe = this.GetRequiredComponentInChildren<QSBProbe>();
|
||||
_light = GetComponent<OWLight2>();
|
||||
_intensity = _light.GetLight().intensity;
|
||||
@ -31,10 +29,10 @@ namespace QSB.ProbeSync
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
DebugLog.DebugWrite("OnDestroy");
|
||||
_probe.OnLaunchProbe -= OnLaunch;
|
||||
_probe.OnAnchorProbe -= OnAnchorOrRetrieve;
|
||||
_probe.OnRetrieveProbe -= OnAnchorOrRetrieve;
|
||||
GlobalMessenger<ProbeCamera>.RemoveListener("ProbeSnapshot", new Callback<ProbeCamera>(OnTakeSnapshot));
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@ -47,6 +45,7 @@ namespace QSB.ProbeSync
|
||||
|
||||
private void StartFadeIn()
|
||||
{
|
||||
DebugLog.DebugWrite("StartFadeIn");
|
||||
if (!enabled)
|
||||
{
|
||||
_light.GetLight().enabled = true;
|
||||
@ -58,6 +57,7 @@ namespace QSB.ProbeSync
|
||||
|
||||
private void OnLaunch()
|
||||
{
|
||||
DebugLog.DebugWrite("OnLaunch");
|
||||
if (_id == ProbeCamera.ID.Forward)
|
||||
{
|
||||
StartFadeIn();
|
||||
@ -68,6 +68,7 @@ namespace QSB.ProbeSync
|
||||
|
||||
private void OnAnchorOrRetrieve()
|
||||
{
|
||||
DebugLog.DebugWrite("OnAnchorOrRetrieve");
|
||||
_light.GetLight().enabled = false;
|
||||
enabled = false;
|
||||
_inFlight = false;
|
||||
|
@ -78,6 +78,11 @@ namespace QSB.Tools
|
||||
Object.Destroy(forwardCamera.GetComponent<ProbeCamera>());
|
||||
Object.Destroy(forwardCamera.GetComponent<OWCamera>());
|
||||
Object.Destroy(forwardCamera.GetComponent<Camera>());
|
||||
var oldForwardSpotlight = forwardCamera.GetComponent<ProbeSpotlight>();
|
||||
var newForwardSpotlight = forwardCamera.gameObject.AddComponent<QSBProbeSpotlight>();
|
||||
newForwardSpotlight._id = oldForwardSpotlight.GetValue<ProbeCamera.ID>("_id");
|
||||
newForwardSpotlight._fadeInLength = oldForwardSpotlight.GetValue<float>("_fadeInLength");
|
||||
Object.Destroy(oldForwardSpotlight);
|
||||
|
||||
// CameraPivot/RotatingCameraPivot/RotatingCamera
|
||||
var rotatingCamera = cameraPivot.Find("RotatingCameraPivot").Find("RotatingCamera");
|
||||
@ -108,6 +113,20 @@ namespace QSB.Tools
|
||||
newLantern._emissiveRenderer = oldLantern.GetValue<OWEmissiveRenderer>("_emissiveRenderer");
|
||||
Object.Destroy(oldLantern);
|
||||
|
||||
// RearCamera
|
||||
var rearCamera = newProbe.Find("RearCamera");
|
||||
Object.Destroy(rearCamera.GetComponent<PostProcessingBehaviour>());
|
||||
Object.Destroy(rearCamera.GetComponent<NoiseImageEffect>());
|
||||
Object.Destroy(rearCamera.GetComponent<PlanetaryFogImageEffect>());
|
||||
Object.Destroy(rearCamera.GetComponent<ProbeCamera>());
|
||||
Object.Destroy(rearCamera.GetComponent<OWCamera>());
|
||||
Object.Destroy(rearCamera.GetComponent<Camera>());
|
||||
var oldRearSpotlight = rearCamera.GetComponent<ProbeSpotlight>();
|
||||
var newRearSpotlight = rearCamera.gameObject.AddComponent<QSBProbeSpotlight>();
|
||||
newRearSpotlight._id = oldRearSpotlight.GetValue<ProbeCamera.ID>("_id");
|
||||
newRearSpotlight._fadeInLength = oldRearSpotlight.GetValue<float>("_fadeInLength");
|
||||
Object.Destroy(oldRearSpotlight);
|
||||
|
||||
Object.Destroy(newProbe.Find("PlaneOffsetMarker_Probe").gameObject);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user