using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class checkFontColor : MonoBehaviour { Color greencolor = new Color(29, 109, 96, 255); Color bluecolor = new Color(255, 255, 255, 255); Color redcolor = new Color(255, 255, 255, 255); private void OnEnable() { Invoke("change",1f); } void change() { if (GetTexture2D.urlbase.Contains("blue")) { this.GetComponent().color = bluecolor; Debug.Log("蓝色"); } else if (GetTexture2D.urlbase.Contains("green")) { this.GetComponent().color = greencolor; Debug.Log("绿色"); } else { this.GetComponent().color = redcolor; Debug.Log("红色"); } } }