mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-10 06:51:36 +00:00
fix clouds appearing in eye state
This commit is contained in:
parent
98c275085a
commit
2baeba1ede
@ -1,5 +1,6 @@
|
||||
using OWML.Utils;
|
||||
using QSB.Events;
|
||||
using QSB.Utility;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
@ -29,7 +30,7 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"Moon to state {message.StateIndex}");
|
||||
var moon = Locator.GetQuantumMoon();
|
||||
var wasPlayerEntangled = moon.IsPlayerEntangled();
|
||||
var location = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent<OWRigidbody>(), moon.transform);
|
||||
@ -49,7 +50,22 @@ namespace QSB.QuantumSync.Events
|
||||
moonBody.SetVelocity(OWPhysics.CalculateOrbitVelocity(owRigidbody, moonBody, message.OrbitAngle) + owRigidbody.GetVelocity());
|
||||
moon.SetValue("_stateIndex", message.StateIndex);
|
||||
|
||||
moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { message.StateIndex });
|
||||
if (moon.IsPlayerInside())
|
||||
{
|
||||
moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { message.StateIndex });
|
||||
}
|
||||
else
|
||||
{
|
||||
moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { -1 });
|
||||
moon.GetValue<AudioSignal>("_quantumSignal").SetSignalActivation(message.StateIndex != 5, 2f);
|
||||
}
|
||||
moon.GetValue<ReferenceFrameVolume>("_referenceFrameVolume").gameObject.SetActive(message.StateIndex != 5);
|
||||
moonBody.SetIsTargetable(message.StateIndex != 5);
|
||||
foreach (var obj in moon.GetValue<GameObject[]>("_deactivateAtEye"))
|
||||
{
|
||||
obj.SetActive(message.StateIndex != 5);
|
||||
}
|
||||
GlobalMessenger<OWRigidbody>.FireEvent("QuantumMoonChangeState", moonBody);
|
||||
|
||||
if (wasPlayerEntangled)
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
____deactivateAtEye[l].SetActive(____stateIndex != 5);
|
||||
}
|
||||
QSBEventManager.FireEvent("QuantumMoonChangeState", ____moonBody);
|
||||
GlobalMessenger<OWRigidbody>.FireEvent("QuantumMoonChangeState", ____moonBody);
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user