123456789101112131415161718192021222324252627282930313233343536 |
- 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<Text>().color = bluecolor;
- Debug.Log("蓝色");
- }
- else if (GetTexture2D.urlbase.Contains("green"))
- {
- this.GetComponent<Text>().color = greencolor;
- Debug.Log("绿色");
- }
- else
- {
- this.GetComponent<Text>().color = redcolor;
- Debug.Log("红色");
- }
- }
- }
|