RobotShow.cs 639 B

1234567891011121314151617181920212223242526
  1. using DG.Tweening;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class RobotShow : MonoBehaviour
  6. {
  7. public GameObject mRobot;
  8. public Material material;
  9. public void OnEnable()
  10. {
  11. material.color = new Color(material.color.r, material.color.g, material.color.b, 0);
  12. material.DOColor(new Color(material.color.r, material.color.g, material.color.b, 1), 3f);
  13. StartCoroutine(OpenRobot());
  14. }
  15. IEnumerator OpenRobot()
  16. {
  17. yield return new WaitForSeconds(2.9f);
  18. mRobot.SetActive(true);
  19. gameObject.SetActive(false);
  20. }
  21. }