mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 00:39:53 +00:00
cleanup
This commit is contained in:
parent
5c9c55c4ca
commit
804a1a826b
@ -1,8 +1,6 @@
|
||||
using OWML.Utils;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QSB.ElevatorSync
|
||||
{
|
||||
|
@ -1,7 +1,6 @@
|
||||
using OWML.Utils;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QSB.QuantumSync
|
||||
|
@ -1,8 +1,5 @@
|
||||
using OWML.Utils;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace QSB.QuantumSync
|
||||
{
|
||||
|
@ -1,9 +1,5 @@
|
||||
using OWML.Common;
|
||||
using OWML.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
@ -4,36 +4,36 @@ using UnityEngine.UI;
|
||||
|
||||
namespace QSB.Utility
|
||||
{
|
||||
public class DebugZOverride : MonoBehaviour
|
||||
{
|
||||
private const string shaderTestMode = "unity_GUIZTestMode";
|
||||
public class DebugZOverride : MonoBehaviour
|
||||
{
|
||||
private const string shaderTestMode = "unity_GUIZTestMode";
|
||||
private readonly UnityEngine.Rendering.CompareFunction desiredUIComparison = UnityEngine.Rendering.CompareFunction.Always;
|
||||
private Graphic[] uiElementsToApplyTo;
|
||||
private Dictionary<Material, Material> materialMappings = new Dictionary<Material, Material>();
|
||||
private Graphic[] uiElementsToApplyTo;
|
||||
private readonly Dictionary<Material, Material> materialMappings = new Dictionary<Material, Material>();
|
||||
|
||||
protected virtual void Start()
|
||||
{
|
||||
uiElementsToApplyTo = gameObject.GetComponentsInChildren<Graphic>();
|
||||
foreach (var graphic in uiElementsToApplyTo)
|
||||
{
|
||||
var material = graphic.materialForRendering;
|
||||
if (material == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
protected virtual void Start()
|
||||
{
|
||||
uiElementsToApplyTo = gameObject.GetComponentsInChildren<Graphic>();
|
||||
foreach (var graphic in uiElementsToApplyTo)
|
||||
{
|
||||
var material = graphic.materialForRendering;
|
||||
if (material == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Material materialCopy;
|
||||
if (!materialMappings.ContainsKey(material))
|
||||
{
|
||||
materialCopy = new Material(material);
|
||||
materialMappings.Add(material, materialCopy);
|
||||
}
|
||||
else
|
||||
{
|
||||
materialCopy = materialMappings[material];
|
||||
}
|
||||
materialCopy.SetInt(shaderTestMode, (int)desiredUIComparison);
|
||||
graphic.material = materialCopy;
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
materialCopy = new Material(material);
|
||||
materialMappings.Add(material, materialCopy);
|
||||
}
|
||||
else
|
||||
{
|
||||
materialCopy = materialMappings[material];
|
||||
}
|
||||
materialCopy.SetInt(shaderTestMode, (int)desiredUIComparison);
|
||||
graphic.material = materialCopy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user