* Changed slider behavior to not take MAX and 0 value as unit counts to send
This commit is contained in:
parent
458d50e4b3
commit
5f7b12c28c
@ -25,8 +25,7 @@ class AtkBoostSkillComponent: GKComponent{
|
||||
}else {
|
||||
base.unitType = .Attack
|
||||
}
|
||||
}
|
||||
})
|
||||
}})
|
||||
super.init()
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,13 @@ class GameScene: SKScene{
|
||||
for e in EntityManager.sharedInstance.entities{
|
||||
if let body = e.component(ofType: ModalContentComponent.self)?.body{
|
||||
GameScene.sendUnits = ((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up)
|
||||
|
||||
//TODO: refactor this quick and dirty fix
|
||||
if GameScene.sendUnits == 0 {
|
||||
GameScene.sendUnits = 1
|
||||
} else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount {
|
||||
GameScene.sendUnits -= 1
|
||||
}
|
||||
body.text = "Schicke \(GameScene.sendUnits) Einheiten "
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user