/** 衝突イベントの検知を終了する. */ public void stopCollision() { if (!mIsCollisionStarted) { return; } mIsCollisionStarted = false; mCollisionListener = null; mDevice.getCollisionControl().removeCollisionListener(this); mDevice.getCollisionControl().stopDetection(); if (BuildConfig.DEBUG) { Log.d("", "stop collision"); } }
/** * 衝突の監視を開始する. * * @param listener リスナー */ public void startCollistion(final DeviceCollisionListener listener) { if (mIsCollisionStarted) { return; } if (BuildConfig.DEBUG) { Log.d("", "start collision"); } mIsCollisionStarted = true; mCollisionListener = listener; mDevice.getCollisionControl().addCollisionListener(this); mDevice.getCollisionControl().startDetection(90, 90, 130, 130, 100); }