Esempio n. 1
0
        public void OnSceneDetach(Scene scene)
        {
            this.Scene = null;
            if (_nodeObject != null)
            {
                _nodeObject.OnSceneDetach(scene);
            }

            //remove the technique from scene
            if (_technique != null)
            {
                _technique.OnSceneDetach(scene);
            }

            //call OnRemove on the childrens
            if (_nodes != null)
            {
                foreach (var item in _nodes)
                {
                    item.OnSceneDetach(scene);
                }
            }

            if (_cullRegion != null)
            {
                _cullRegion.Remove(this);
                _cullRegion = null;
            }
        }
Esempio n. 2
0
        public void OnSceneAttach(Scene scene)
        {
            this.Scene = scene;

            //add the technique to the scene
            if (_technique != null)
            {
                _technique.OnSceneAttach(scene);
            }

            if (_nodeObject != null)
            {
                //add the object to the scene
                _nodeObject.OnSceneAttach(scene);

                //Add to the region Culler
                _cullRegion = scene.GetCullRegion(this);
            }

            if (_nodes != null)
            {
                foreach (var item in _nodes)
                {
                    item.OnSceneAttach(scene);
                }
            }
        }