ButtonFix.cs 679 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using System.Collections;
  3. public class ButtonFix : MonoBehaviour {
  4. // Use this for initialization
  5. void Start ()
  6. {
  7. var scale = GetComponent<UIButtonScale>();
  8. if (scale)
  9. {
  10. scale.hover = Vector3.one;
  11. scale.pressed = Vector3.one * 0.95f;
  12. }
  13. var color = GetComponent<UIButtonColor>();
  14. if (color)
  15. {
  16. color.hover = new Color(1,1,1,1f);
  17. color.pressed = new Color(1,1,1,1);
  18. }
  19. var button = GetComponent<UIButton>();
  20. if (button)
  21. {
  22. button.defaultColor = new Color(1, 1, 1, 1f);
  23. }
  24. }
  25. // Update is called once per frame
  26. void Update () {
  27. }
  28. }