Ejemplo n.º 1
0
        public void RemoveComponent <T>()
        {
            Component2D Com = Components.Find(x => x is T);

            if (Com != null)
            {
                Components.Remove(Com);
            }
            else
            {
                Debug.LogError("2DObject \"" + ObjectName + "\" does not already contain the component \"" + typeof(T).Name + "\"");
            }
        }
Ejemplo n.º 2
0
        public Component2D AddComponent(Component2D component)
        {
            if (component != null)
            {
                Components.Add(component);
                component.LinkedObject = this;
                component.Awake();
                component.Start();
                if (ComponentAdded != null)
                {
                    ComponentAdded(component);
                }
            }

            return(component);
        }
Ejemplo n.º 3
0
        public bool HasComponent <T>()
        {
            Component2D com = Components.Find(x => x is T);

            return(com != null ? true : false);
        }