Пример #1
0
        public GameObject(BeatEmUpGame game)
        {
            this.game = game;

            behaviours       = new TypeSortedContainer <Behaviour>();
            componentManager = new ComponentManager(this);
            tags             = new TagContainer();

            string stateName = game.StateManager.CurrentName;

            tags.AddTag(stateName);

            OnDestroy += delegate { };
            OnDisable += delegate { };
            OnEnable  += delegate { };
            OnShow    += delegate { };
            OnHide    += delegate { };

            size   = new Vector2(1f);
            body   = new Body(this, new BoxShape(size.X, size.Y), Vector2.Zero);
            childs = new List <GameObject>();

            enabled = true;
            visible = true;

            name = this.GetType().Name;
        }
Пример #2
0
        public ComponentManager(GameObject owner)
        {
            this.owner = owner;

            components = new TypeSortedContainer <GameObjectComponent>();
            sortedDrawableComponents = new List <GameObjectComponent>();

            ComponentAdded   += delegate { };
            ComponentRemoved += delegate { };
        }