Add hung color to input dialog entry.

This commit is contained in:
2023-12-02 00:30:55 +08:00
parent 446724f9ca
commit 6d714c972b
2 changed files with 11 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ namespace Cryville.Crtr.Config.UI {
[SerializeField] Graphic m_iW;
[SerializeField] Color m_invalidColor;
[SerializeField] Color m_inactiveColor;
[SerializeField] Color m_hungColor;
[SerializeField] Color m_activeColor;
[SerializeField] Color m_restColor;
[SerializeField] Color m_motionColor;
@@ -61,6 +62,14 @@ namespace Cryville.Crtr.Config.UI {
Clicked?.Invoke();
}
bool _hung;
void Update() {
if (_activeInputs.Count > 0) {
if (_hung) m_iNull.color = m_hungColor;
else _hung = true;
}
}
float _maxScalar;
Dictionary<int, InputVector> _activeInputs;
public void OnInputEvent(InputEvent ev) {
@@ -91,6 +100,7 @@ namespace Cryville.Crtr.Config.UI {
_activeInputs[id] = vec;
}
m_iNull.color = _activeInputs.Count > 0 ? m_activeColor : m_inactiveColor;
_hung = false;
}
void UpdateVectorIndicator(Graphic i, float v) {
float a = MathF.Abs(v);

View File

@@ -866,6 +866,7 @@ MonoBehaviour:
m_iW: {fileID: 2244049687317785014}
m_invalidColor: {r: 0.25, g: 0.25, b: 0.25, a: 1}
m_inactiveColor: {r: 0.125, g: 0.25, b: 0.125, a: 1}
m_hungColor: {r: 0.6, g: 0.6, b: 0.30294117, a: 1}
m_activeColor: {r: 0.5, g: 1, b: 0.5, a: 1}
m_restColor: {r: 0.125, g: 0.1875, b: 0.25, a: 1}
m_motionColor: {r: 0.5, g: 0.75, b: 1, a: 1}