From a22c505984697881f5f911a165ee022087b69e09 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 20 May 2024 22:36:58 +0800 Subject: *rename --- .../ControllerUIEffect.cs | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 Thronefall_1_0/Rewired/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs (limited to 'Thronefall_1_0/Rewired/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs') diff --git a/Thronefall_1_0/Rewired/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs b/Thronefall_1_0/Rewired/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs deleted file mode 100644 index 695aa76..0000000 --- a/Thronefall_1_0/Rewired/Rewired.Demos.GamepadTemplateUI/ControllerUIEffect.cs +++ /dev/null @@ -1,57 +0,0 @@ -using UnityEngine; -using UnityEngine.UI; - -namespace Rewired.Demos.GamepadTemplateUI; - -[RequireComponent(typeof(Image))] -public class ControllerUIEffect : MonoBehaviour -{ - [SerializeField] - private Color _highlightColor = Color.white; - - private Image _image; - - private Color _color; - - private Color _origColor; - - private bool _isActive; - - private float _highlightAmount; - - private void Awake() - { - _image = GetComponent(); - _origColor = _image.color; - _color = _origColor; - } - - public void Activate(float amount) - { - amount = Mathf.Clamp01(amount); - if (!_isActive || amount != _highlightAmount) - { - _highlightAmount = amount; - _color = Color.Lerp(_origColor, _highlightColor, _highlightAmount); - _isActive = true; - RedrawImage(); - } - } - - public void Deactivate() - { - if (_isActive) - { - _color = _origColor; - _highlightAmount = 0f; - _isActive = false; - RedrawImage(); - } - } - - private void RedrawImage() - { - _image.color = _color; - _image.enabled = _isActive; - } -} -- cgit v1.1-26-g67d0