make conv. boxes ignore Z always, fix multiple AttachedObjects

This commit is contained in:
Mister_Nebula 2021-05-02 09:09:37 +01:00
parent 84358dbb3d
commit 86a871889d
6 changed files with 5 additions and 8 deletions

View File

@ -122,6 +122,7 @@ namespace QSB.ConversationSync
lookAt.SetValue("_localFacingVector", Vector3.back);
lookAt.SetValue("_localRotationAxis", Vector3.up);
newBox.GetComponent<Text>().text = text;
newBox.AddComponent<ZOverride>();
newBox.SetActive(true);
return newBox;
}

View File

@ -279,7 +279,7 @@
<Compile Include="SectorSync\SectorSync.cs" />
<Compile Include="Utility\CustomCallbacks.cs" />
<Compile Include="Utility\DebugBoxManager.cs" />
<Compile Include="Utility\DebugZOverride.cs" />
<Compile Include="Utility\ZOverride.cs" />
<Compile Include="Utility\Extensions.cs" />
<Compile Include="Utility\GlobalMessenger4Args.cs" />
<Compile Include="Utility\GlobalMessenger5Args.cs" />

View File

@ -246,10 +246,6 @@ namespace QSB
QSBNetworkManager.Instance.networkPort = Port;
}
DebugMode = config.GetSettingsValue<bool>("debugMode");
if (!DebugMode)
{
FindObjectsOfType<DebugZOverride>().ToList().ForEach(x => Destroy(x.gameObject));
}
ShowLinesInDebug = config.GetSettingsValue<bool>("showLinesInDebug");
SocketedObjToDebug = config.GetSettingsValue<int>("socketedObjToDebug");
}

View File

@ -62,7 +62,7 @@ namespace QSB.TransformSync
protected virtual void Init()
{
if (AttachedObject != null)
if (!HasAuthority && AttachedObject != null)
{
Destroy(AttachedObject);
}

View File

@ -33,7 +33,7 @@ namespace QSB.Utility
lookAt.SetValue("_localFacingVector", Vector3.back);
lookAt.SetValue("_localRotationAxis", Vector3.up);
newBox.GetComponent<Text>().text = text;
newBox.AddComponent<DebugZOverride>();
newBox.AddComponent<ZOverride>();
newBox.SetActive(true);
return newBox;
}

View File

@ -4,7 +4,7 @@ using UnityEngine.UI;
namespace QSB.Utility
{
public class DebugZOverride : MonoBehaviour
public class ZOverride : MonoBehaviour
{
private const string shaderTestMode = "unity_GUIZTestMode";
private readonly UnityEngine.Rendering.CompareFunction desiredUIComparison = UnityEngine.Rendering.CompareFunction.Always;