Created
June 6, 2018 02:22
-
-
Save Pudding124/469faf61e9899ae7ec09d0cb41d7ae93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 控制連擊動畫 | |
func AnimateAlpha(comboNumber : Int) { | |
self.combo.alpha = 1 | |
if comboNumber > 0{ | |
combo.text = String(comboNumber)+" COMBO" | |
} | |
UIView.animate(withDuration: 0.7, delay: 0, animations: { | |
self.combo.alpha -= 1 | |
self.combo.transform = CGAffineTransform.identity | |
.translatedBy(x: -100, y: 0) | |
.rotated(by:CGFloat(Double.pi/4)) | |
.scaledBy(x: 2, y: 2) | |
}, completion: { _ in | |
self.combo.transform = CGAffineTransform.identity | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment