Esempio n. 1
0
        protected Component(Node owner)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }
            if (owner.IsDisposed)
            {
                throw new ObjectDisposedException("owner");
            }

            _isStarted  = false;
            _isDisposed = false;
            IsEnabled   = true;
            Id          = Guid.NewGuid();

            _sceneObject = owner;
            _transform   = _sceneObject.Transform;
            _scene       = _sceneObject.Scene;
            _time        = _scene.Time;

            Assert.NotNull(_transform);
            Assert.NotNull(_scene);
            Assert.NotNull(_time);

            _sceneObject.AddComponent(this);

            OnInit();
        }
Esempio n. 2
0
        internal Scene(NetGLControl control, Graphics graphics, SceneTime time)
        {
            Assert.NotNull(control);

            _control  = control;
            _time     = time;
            _graphics = graphics;

            SceneObjects = _sceneObjects.AsReadOnly();

            DrawCalls = 0;
            FrameNo   = 0;
        }
Esempio n. 3
0
        public Node(Scene scene, string name)
        {
            Assert.NotNull(scene);

            this.IsSerialized = true;
            this.Name         = name;
            this.IsDisposed   = false;

            _scene = scene;
            _time  = _scene.Time;

            _transform  = new Transform(this);
            _components = new List <Component>();
            Components  = _components.AsReadOnly();

            Id    = Guid.NewGuid();
            Layer = Layer.Default;

            _scene.Add(this);
        }