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