ButtonFX.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using DG.Tweening;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class ButtonFX : MonoBehaviour
  6. {
  7. // Start is called before the first frame update
  8. //126 219 255 128
  9. public bool isUserEnterClick;
  10. public Vector3 moveToEndV3;
  11. private Renderer renderers;
  12. void Start()
  13. {
  14. renderers = this.GetComponent<Renderer>();
  15. }
  16. // Update is called once per frame
  17. void Update()
  18. {
  19. }
  20. public string currentEnterStr;
  21. public string LastStr;
  22. private bool isOne;
  23. public void userEnterClick(bool isEnter,string buttonName)
  24. {
  25. currentEnterStr = buttonName;
  26. if(currentEnterStr== currentUserClikcStr)
  27. {
  28. return;
  29. }
  30. else
  31. {
  32. if(isEnter)
  33. {
  34. this.gameObject.transform.position = moveToEndV3;
  35. renderers.material.DOColor(new Color(126 / 255f, 219 / 255f, 255f, 128), "_TintColor", 0.2f);
  36. }
  37. else
  38. {
  39. renderers.material.DOColor(new Color(0, 0, 0, 128), "_TintColor", 0.2f);
  40. }
  41. }
  42. }
  43. private string currentUserClikcStr;
  44. public void userClickButtonStr(string str)
  45. {
  46. currentUserClikcStr = str;
  47. }
  48. }