public static GameObject OnDestroy(this GameObject gameObject, ActionOnDestroy.Properties p) { // Add the component ActionOnDestroy.AddComponent(gameObject, p); // Return to fluent design return(gameObject); }
public static GameObject OnDestroy(this GameObject gameObject, Action action) { // Add the component ActionOnDestroy.AddComponent(gameObject, new ActionOnDestroy.Properties { enable = true, onDestroy = action }); // Return to fluent design return(gameObject); }