public void onSpeedBoost(Outline speedButton) { if (text == null) { text = speedButton.GetComponentInChildren <Text>(); } isBoosted = !isBoosted; if (isBoosted) { UnitConfig.animaitionSpeed = UnitConfig.normalSpeed * 2; speedButton.effectColor = boostColor; text.color = boostColor; } else { UnitConfig.animaitionSpeed = UnitConfig.normalSpeed; speedButton.effectColor = normal; text.color = normal; } }