public UnityEngine.Component AddComponent(Type t) { var c = InternalGameObject.AddComponent(t); if (c != null) { m_attachedComponents.Add(new ComponentInfo(t, c)); Save(); } return(c); }
public T AddComponent <T> () where T : UnityEngine.Component { var c = InternalGameObject.AddComponent <T> (); if (c != null) { m_attachedComponents.Add(new ComponentInfo(typeof(T), c)); Save(); } return(c); }