protected override void Dispose(bool disposing)
        {
            if (!Initialized || m_disposed)
            {
                return;
            }

            m_messenger.RemoveListener <SetTargetMessage>(HandleSetTarget);
            m_messenger.RemoveListener <ShootingStateMessage>(HandleShootingStateChange);

            base.Dispose(disposing);
            m_disposed = true;
        }
        protected override void Dispose(bool disposing)
        {
            if (m_disposed || !Initialized)
            {
                return;
            }

            PhysicsManager.PreStep -= HandlePreStep;

            m_messenger.RemoveListener <MoveMessage>(HandleMoveMessage);
            m_messenger.RemoveListener <TankKilledMessage>(HandleTankKilled);

            base.Dispose(disposing);
            m_disposed = true;
        }
Exemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            if (!Initialized || m_disposed)
            {
                return;
            }

            m_messenger.RemoveListener <SensorNewContactMessage>(
                HandleSensorNewContact);
            m_messenger.RemoveListener <SensorNewContactMessage>(
                HandleSensorLostContact);
            m_eventManager.RemoveListener <TankKilledEvent>(HandleTankKilledEvent);
            m_physicsManager.PostStep -= HandlePostStep;

            base.Dispose(disposing);
            m_disposed = true;
        }
Exemplo n.º 4
0
        protected override void Dispose(bool disposing)
        {
            if (!Initialized || m_disposed)
            {
                return;
            }

            m_physicsManager.PostStep -= HandlePostStep;
            m_body.OnCollision        -= HandleSensorCollision;
            m_body.OnSeparation       -= HandleSensorSeparation;

            m_physicsManager.World.RemoveBody(m_body);
            m_body = null;

            m_messenger.RemoveListener <TankKilledMessage>(HandleTankKilled);

            base.Dispose(disposing);
            m_disposed = true;
        }