| | |
| | | |
| | | public static Material GetDefaultSpriteGrayMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Material", "SpriteGray"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "SpriteGray"); |
| | | } |
| | | |
| | | public static Material GetInstantiatedSpriteGrayMaterial() |
| | |
| | | |
| | | public static Material GetSmoothMaskGrayMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Material", "SmoothMaskGray"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "SmoothMaskGray"); |
| | | } |
| | | |
| | | public static Material GetInstantiatedSpriteTwinkleMaterial() |
| | | { |
| | | var material = ResManager.Instance.LoadAsset<Material>("Material", "Flash"); |
| | | var material = ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "Flash"); |
| | | return new Material(material); |
| | | } |
| | | |
| | |
| | | return UnityEngine.UI.Image.defaultGraphicMaterial; |
| | | } |
| | | |
| | | public static Material GetUIBlurMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Material", "GUIBlurMaterial"); |
| | | } |
| | | |
| | | public static Material GetGUIRenderTextureMaterial() |
| | | { |
| | | return ResManager.Instance.LoadAsset<Material>("Material", "UI_RenderTexture"); |
| | | return ResManager.Instance.LoadAsset<Material>("BuiltIn/Materials", "UI_RenderTexture"); |
| | | } |
| | | |
| | | public static void SetRenderSortingOrder(this GameObject root, int sortingOrder, bool includeChildren) |
| | |
| | | renderer.sortingOrder = sortingOrder; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | static Shader m_HeroShader; |
| | | static Shader m_PlayerShader; |
| | | static Shader heroShader { |
| | | get { |
| | | if (m_HeroShader == null) |
| | | { |
| | | m_HeroShader = Shader.Find("Character/Character,Emission,Flow_Hero"); |
| | | } |
| | | |
| | | if (m_HeroShader == null) |
| | | { |
| | | m_HeroShader = Shader.Find("Character/Character, Emission,Flow_Hero"); |
| | | } |
| | | |
| | | return m_HeroShader; |
| | | } |
| | | } |
| | | |
| | | static Shader playerShader { |
| | | get { |
| | | if (m_PlayerShader == null) |
| | | { |
| | | m_PlayerShader = Shader.Find("Character/Character,Emission,Flow"); |
| | | } |
| | | |
| | | if (m_PlayerShader == null) |
| | | { |
| | | m_PlayerShader = Shader.Find("Character/Character, Emission,Flow"); |
| | | } |
| | | |
| | | return m_PlayerShader; |
| | | } |
| | | } |
| | | |
| | | public static void SwitchXrayShader(Material _material, bool _isHero) |
| | | { |
| | | if (_material == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (_isHero) |
| | | { |
| | | if (_material.shader.name != "Character/Character,Emission,Flow_Hero" && _material.shader.name != "Character/Character, Emission,Flow_Hero") |
| | | { |
| | | _material.shader = heroShader; |
| | | _material.SetColor("_XRayColor", new Color32(0, 107, 255, 255)); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (_material.shader.name != "Character/Character, Emission,Flow" && _material.shader.name != "Character/Character,Emission,Flow") |
| | | { |
| | | _material.shader = playerShader; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |