ButtonManager.cs 756 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using DG.Tweening;
  5. public class ButtonManager : MonoBehaviour
  6. {
  7. public UIManager uiManager;
  8. public InputManager inputManager;
  9. public string val;
  10. // Start is called before the first frame update
  11. void Start()
  12. {
  13. }
  14. // Update is called once per frame
  15. void Update()
  16. {
  17. if(uiManager.OnEnetered(gameObject))
  18. {
  19. transform.DOScale(Vector3.one * 2, 0.2f);
  20. //transform.localScale = Vector3.one * 2;
  21. inputManager.ChangeSelection(val);
  22. }
  23. else
  24. {
  25. transform.DOScale(Vector3.one, 0.2f);
  26. //transform.localScale = Vector3.one;
  27. }
  28. }
  29. }