using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; public class RobotShow : MonoBehaviour { public GameObject mRobot; public Material material; public void OnEnable() { material.color = new Color(material.color.r, material.color.g, material.color.b, 0); material.DOColor(new Color(material.color.r, material.color.g, material.color.b, 1), 3f); StartCoroutine(OpenRobot()); } IEnumerator OpenRobot() { yield return new WaitForSeconds(2.9f); mRobot.SetActive(true); gameObject.SetActive(false); } }