minor fixes
This commit is contained in:
1 parent
67af68fcf1
commit
99a2a4ca1a
2 files changed
+4
-4
No files matched your search
@@ -100,7 +100,7 @@ import CoreMotion
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc public func startAccelUpdate() {
|
@objc public func startAccelUpdate() {
|
||||||
gyroControlStarted = true
|
accelControlStarted = true
|
||||||
if motionManager.isAccelerometerAvailable {
|
if motionManager.isAccelerometerAvailable {
|
||||||
motionManager.startAccelerometerUpdates(to: .main) { [weak self] accelData, _ in
|
motionManager.startAccelerometerUpdates(to: .main) { [weak self] accelData, _ in
|
||||||
guard let self = self, let data = accelData else { return }
|
guard let self = self, let data = accelData else { return }
|
||||||
@@ -114,8 +114,8 @@ import CoreMotion
|
|||||||
/// 停止更新
|
/// 停止更新
|
||||||
@objc public func stopGyroUpdate() {
|
@objc public func stopGyroUpdate() {
|
||||||
gyroControlStarted = false
|
gyroControlStarted = false
|
||||||
if motionManager.isAccelerometerActive {
|
if motionManager.isGyroActive{
|
||||||
motionManager.stopAccelerometerUpdates()
|
motionManager.stopGyroUpdates()
|
||||||
}
|
}
|
||||||
self.onScreenControls.clearLeftStickTouchPadFlag()
|
self.onScreenControls.clearLeftStickTouchPadFlag()
|
||||||
self.onScreenControls.clearRightStickTouchPadFlag()
|
self.onScreenControls.clearRightStickTouchPadFlag()
|
||||||
|
|||||||
@@ -1681,7 +1681,7 @@ import UIKit
|
|||||||
self.onScreenControls.clearLeftStickTouchPadFlag()
|
self.onScreenControls.clearLeftStickTouchPadFlag()
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
self.mixInputDelegate?.mixRightStickAndGyroInput(x: 0, y: 0)
|
self.mixInputDelegate?.mixLeftStickAndGyroInput(x: 0, y: 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user