| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | namespace vnxbqy.UI |
| | | |
| | | public class GrayGroup : MonoBehaviour |
| | | { |
| | | |
| | | public class GrayGroup : MonoBehaviour |
| | | { |
| | | Image[] m_Images; |
| | | Image[] images { |
| | | get { |
| | | if (m_Images == null) |
| | | { |
| | | m_Images = this.GetComponentsInChildren<Image>(); |
| | | } |
| | | return m_Images; |
| | | } |
| | | } |
| | | |
| | | Image[] m_Images; |
| | | Image[] images { |
| | | get { |
| | | if (m_Images == null) |
| | | bool m_Gray = false; |
| | | public bool gray { |
| | | get { return m_Gray; } |
| | | set { |
| | | m_Gray = value; |
| | | |
| | | for (int i = 0; i < images.Length; i++) |
| | | { |
| | | var image = images[i]; |
| | | if (this.m_Gray) |
| | | { |
| | | m_Images = this.GetComponentsInChildren<Image>(); |
| | | image.material = MaterialUtility.GetDefaultSpriteGrayMaterial(); |
| | | } |
| | | return m_Images; |
| | | else |
| | | { |
| | | image.material = MaterialUtility.GetUIDefaultGraphicMaterial(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | bool m_Gray = false; |
| | | public bool gray { |
| | | get { return m_Gray; } |
| | | set { |
| | | m_Gray = value; |
| | | |
| | | for (int i = 0; i < images.Length; i++) |
| | | { |
| | | var image = images[i]; |
| | | if (this.m_Gray) |
| | | { |
| | | image.material = MaterialUtility.GetDefaultSpriteGrayMaterial(); |
| | | } |
| | | else |
| | | { |
| | | image.material = MaterialUtility.GetUIDefaultGraphicMaterial(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |