Exemplo n.º 1
0
        /// <summary>
        /// Add an entity to the scene
        /// </summary>
        /// <param name="entity">An entitiy</param>
        public void Add(YnEntity entity)
        {
            if (Initialized && !entity.Initialized)
            {
                entity.Initialize();
            }

            if (AssetLoaded && !entity.AssetLoaded)
            {
                entity.LoadContent();
            }

            _scene.Add(entity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a new object in the collecion
        /// </summary>
        /// <param name="sceneObject">An object or derivated from YnObject</param>
        public void Add(YnEntity sceneObject)
        {
            sceneObject.Parent = this;

            if (_initialized)
            {
                sceneObject.Initialize();
            }

            if (_assetsLoaded)
            {
                sceneObject.LoadContent();
            }

            UpdateRectangle();

            _entitiesList.Add(sceneObject);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add an entity to the scene
        /// </summary>
        /// <param name="entity">An entitiy</param>
        public void Add(YnEntity entity)
        {
            if (Initialized && !entity.Initialized)
                entity.Initialize();

            if (AssetLoaded && !entity.AssetLoaded)
                    entity.LoadContent();
       
            _scene.Add(entity);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Add a new object in the collecion
        /// </summary>
        /// <param name="sceneObject">An object or derivated from YnObject</param>
        public void Add(YnEntity sceneObject)
        {
            sceneObject.Parent = this;

            if (_initialized)
                sceneObject.Initialize();

            if (_assetsLoaded)
                sceneObject.LoadContent();

            UpdateRectangle();

            _entitiesList.Add(sceneObject);
        }