Improve attack cooldown and attack distance indicators
This commit is contained in:
@@ -14,6 +14,6 @@ public class AttackCooldown : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Mathf.Min(100*(Time.fixedTime-player.lastAttackTime)/player.attackCooldownSeconds, 100));
|
||||
GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Mathf.Max(0, 100-100*(Time.fixedTime-player.lastAttackTime)/player.attackCooldownSeconds));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class DistanceIndicator : MonoBehaviour
|
||||
}
|
||||
|
||||
void Update() {
|
||||
sprite.color = new Color (1F, 1F, 1F, 0.5F-(Time.fixedTime-timeCreated));
|
||||
sprite.color = new Color (0F, 0F, 0F, 0.5F-(Time.fixedTime-timeCreated));
|
||||
}
|
||||
|
||||
IEnumerator KillMyself() {
|
||||
|
||||
Reference in New Issue
Block a user