| | |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | using System.Collections.Generic; |
| | | using Cysharp.Threading.Tasks; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | // #if UNITY_EDITOR |
| | | |
| | | var texMaterial = ResManager.Instance.LoadAsset<Material>("Materials", "OutlineMat"); |
| | | if (texMaterial != null) |
| | | ResManager.Instance.LoadAssetAsync<Material>("Materials", "OutlineMat").ContinueWith(texMaterial => |
| | | { |
| | | base.graphic.material = texMaterial; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("没有找到材质OutlineMat.mat"); |
| | | } |
| | | if (texMaterial != null) |
| | | { |
| | | base.graphic.material = texMaterial; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("没有找到材质OutlineMat.mat"); |
| | | } |
| | | }).Forget(); |
| | | |
| | | // #else |
| | | // var shader = Shader.Find("TSF Shaders/UI/OutlineEx"); |
| | | // base.graphic.material = new Material(shader); |
| | |
| | | { |
| | | if (base.graphic.material.shader.name != "TSF Shaders/UI/OutlineEx") |
| | | { |
| | | var texMaterial = ResManager.Instance.LoadAsset<Material>("Materials", "OutlineMat"); |
| | | if (texMaterial != null) |
| | | ResManager.Instance.LoadAssetAsync<Material>("Materials", "OutlineMat").ContinueWith(texMaterial => |
| | | { |
| | | base.graphic.material = texMaterial; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("没有找到材质OutlineMat.mat"); |
| | | } |
| | | if (texMaterial != null) |
| | | { |
| | | base.graphic.material = texMaterial; |
| | | } |
| | | else |
| | | { |
| | | Debug.LogError("没有找到材质OutlineMat.mat"); |
| | | } |
| | | }).Forget(); |
| | | //var shader = Shader.Find("TSF Shaders/UI/OutlineEx"); |
| | | //base.graphic.material = new Material(shader); |
| | | } |