Exemplo n.º 1
0
        public override void Start()
        {
            _physics = GetComponent <PhysicsComponent>();
            if (_physics == null)
            {
                throw new ArgumentNullException("A crate needs a physics component attached");
            }

            _physics.AddGameObject(GameObject);
            _physics.StorePreviousVelocity = true;
            _physics.OnCollision          += onCollision;
        }
Exemplo n.º 2
0
        public override void Start()
        {
            _physics = GetComponent <PhysicsComponent>();
            if (_physics == null)
            {
                throw new ArgumentNullException("PhysicalBarrier needs a physics component attached");
            }

            _physics.AddGameObject(GameObject);
            _physics.OnCollision += onCollision;

            if (Health == 0)
            {
                _indestructible = true;
            }
        }