TianJiText.cs 503 B

123456789101112131415161718192021
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class TianJiText : MonoBehaviour
  6. {
  7. void Awake()
  8. {
  9. Text text =this.GetComponent<Text>();
  10. if(text!=null)
  11. {
  12. Debug.Log("text.color===>"+text.color +"_"+text.name);
  13. }
  14. }
  15. // 方法2:反转RGB值
  16. Color InvertColorSimple(Color original)
  17. {
  18. return new Color(1 - original.r, 1 - original.g, 1 - original.b, original.a);
  19. }
  20. }