using System; using System.Collections; using UnityEngine; public static class ExpandTool { public static GameObject DelayEvents(this GameObject obj, Action action, float delayTime = .1f) { obj.GetComponent().StartCoroutine(Delayer(action, delayTime)); return obj; } public static IEnumerator Delayer(Action action, float delayTime = .1f) { yield return new WaitForSeconds(delayTime); action?.Invoke(); } }