Beispiel #1
0
		public void AddComponent(IComponent component)
		{
			if (this.EditorEnabled || component.Entity == null || component.Entity.CannotSuspend)
				component.Suspended.Value = false;

			component.SetMain(this);
			if (typeof(IGraphicsComponent).IsAssignableFrom(component.GetType()))
				((IGraphicsComponent)component).LoadContent(false);
			component.Awake();
			this.componentsToAdd.Add(component);
		}
Beispiel #2
0
        public void AddComponent(IComponent component)
        {
            if (this.EditorEnabled || component.Entity == null || component.Entity.CannotSuspend)
            {
                component.Suspended.Value = false;
            }

            component.SetMain(this);
            if (typeof(IGraphicsComponent).IsAssignableFrom(component.GetType()))
            {
                ((IGraphicsComponent)component).LoadContent(false);
            }
            component.Awake();
            this.componentsToAdd.Add(component);
        }
Beispiel #3
0
 public void RegisterComponent(IComponent component)
 {
     components.Add(component);
     component.Awake();
 }