コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }