源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
889 B

  1. using UnityEngine.UI;
  2. using UnityEngine;
  3. namespace LuaFramework
  4. {
  5. public class RawImageExtend : RawImage
  6. {
  7. private float _alpha = 1.0F;
  8. public float alpha
  9. {
  10. get { return _alpha; }
  11. set { SetAlpha(value); }
  12. }
  13. private void SetAlpha(float value)
  14. {
  15. _alpha = value;
  16. color = new UnityEngine.Color(color.r, color.g, color.b, _alpha);
  17. }
  18. private bool _gray = false;
  19. public bool gray
  20. {
  21. get { return _gray; }
  22. set { SetGray(value); }
  23. }
  24. private void SetGray(bool value)
  25. {
  26. _gray = value;
  27. if (_gray)
  28. {
  29. material = Resources.Load("material/Gray") as Material;
  30. }
  31. else
  32. {
  33. material = null;
  34. }
  35. }
  36. }
  37. }