using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class AutoDisable : MonoBehaviour { [SerializeField] private PlayTween m_PlayTween = null; [SerializeField] float m_DelayTime = 3.0f; private void OnEnable() { Invoke("DisableMyself", m_DelayTime); } private void DisableMyself() { if (m_PlayTween != null) m_PlayTween.PlayReverse(); } }