UIDetailInfoController.cs 665 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using UnityEngine;
  3. public class UIDetailInfoController : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. this.container.gameObject.SetActive(true);
  8. }
  9. private void Update()
  10. {
  11. if (this.play)
  12. {
  13. this.container.alpha = 0f;
  14. this.container.transform.position -= new Vector3(2f, 0f, 0f);
  15. this.play = false;
  16. }
  17. if (this.container.alpha < 1f)
  18. {
  19. this.container.alpha += 1f * Time.deltaTime;
  20. this.container.transform.position += new Vector3(1f * Time.deltaTime, 0f, 0f);
  21. }
  22. else
  23. {
  24. this.play = false;
  25. }
  26. }
  27. [SerializeField]
  28. private UIWidget container;
  29. [SerializeField]
  30. private bool play;
  31. }